ticktest
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

ticktest

ticktest is an easy-to-use and capable micro test framework.

Docs are here

Usage

Install using npm

npm i ticktest --save-dev

Or clone the repo and build

git clone https://github.com/rocketicv/ticktest.git

npm i
npm i --only=dev
npm run build # Optional, already built in dist/ folder

To use ticktest in your code

const ticktest = require('ticktest')
const lib = require('lib')

new ticktest.Tick('lib')
    .test('double')
        .it('should return 4 when 2 is passed')
            .when(lib.double(2))
            .equals(4)
    .test('halve')
        .it('should return 1 when 2 is passed')
            .when(lib.halve(2))
            .equals(1)
    .finish()

Or, in TypeScript, with only a change to the import

import * as ticktest from 'ticktest'
import * as lib from 'lib'

Documentation

Full docs are here, basic usage is below.

After importing ticktest, use this pattern

new ticktest.Tick('myLib') // Optional argument, name of project being tested.
    .test('firstFunction')
        .it('should return 1') // Describe expected result.
            .when(myLib.firstFunction())
            .equals(1)
    .finish()

The output is

myLib
    firstFunction
        should return 1 ☑
1 / 1 passed, 0 / 1 failed. 100% success rate.

License

ticktest is under the MIT license, found in the LICENSE file and below.

The MIT License

Copyright (c) 2018 rocketicv <rocketicv@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Readme

Keywords

none

Package Sidebar

Install

npm i ticktest

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

7.55 kB

Total Files

5

Last publish

Collaborators

  • rocketicv