node package manager

tst

Minimalistic test runner for node/browser

TST

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

// ./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

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

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

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