mintest-green
v0.2.3
Published
Minimal test framework
Downloads
11
Maintainers
Readme
mintest-green
Fully typed minimalistic test-runner.
Heavily inspired by baretest.
Content
What is this?
This package is a minimalistic and blazing fast test-runner, completely written in TypeScript.
When should I use this?
If the startup time of Jest bothers you and the notation and lack of types in baretest bothers you, too.
Install
This package is ESM only.
In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm
:
npm install mintest-green
Use
import { assert, describe } from './mintest';
let count = 0;
function incr() {
count++;
}
await describe('mintest', function (test) {
test.beforeEach(incr);
test('Foo', function () {
assert.equal(2 + 2, 4);
});
test('Bar', function () {
assert.equal(2 + 2, 4, 'Oh no!');
});
test.skip('Baz', function () {
assert.equal(2 + 2, 5, 'This does not matter');
});
});
assert.equal(count, 2);
describe
is an async function in which you can describe your unit under test. Use the test util and its sub-features to do that.
This is still in very early alpha, use at your own risk.