Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    tstpublic

    TST

    Minimalistic test runner for browser and node with mocha/tap-compatible API.

    npm install tst

    // ./test.js 
     
    var test = require('tst');
    var assert = require('assert');
     
     
    test('Test trivial things', function() {
        var success = true;
        assert.equal(success, true);
    });
     
    test.skip('Do not test unwanted things', function () {
        var $ = require('jquery');
    });
     
    test('Group tests', function () {
        test('A', function () {
     
        });
        test('B', function () {
     
        });
    });
     
    test.only('Test of interest', function () {
        //this test is run exclusively 
    });
     
    test('Async stuff', function (done) {
        this.timeout(3000);
        setTimeout(done, 2100);
    })
    .after(function () {
        //will be invoked after test 
    })
    .before(function () {
        //will be invoked before the test 
    });

    Run in node: $ node ./test.js

    Terminal

    or in browser: $ beefy ./test.js.

    Browser

    If you’ve changed your mind, just return to mocha: var test = it;.

    Related

    ava — futuristic test runner by @sindresorhus.
    mocha — vintage test runner by @tj.
    tape — Test Anything Protocol by @substack.
    tap — Test Anything Protocol by @isaacs
    tst — initial version of tst by @grahamlyons

    install

    npm i tst

    Downloadslast 7 days

    7

    version

    1.3.2

    license

    BSD

    repository

    github.com

    last publish

    collaborators

    • avatar
    • avatar