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

0.2.3 • Public • Published

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.

Package Sidebar

Install

npm i mintest-green

Weekly Downloads

1

Version

0.2.3

License

MIT

Unpacked Size

16.8 kB

Total Files

6

Last publish

Collaborators

  • shackhacker-christian