unittest

raw JSON →
1.0.0 verified Sat Apr 25 auth: no javascript

A unit test case example package. Version 1.0.0 provides basic test utilities. Minimal documentation and no recent updates. Sporadic release cadence.

error TypeError: unittest_1.TestCase is not a constructor
cause Using default import instead of named import for TestCase.
fix
Use import { TestCase } from 'unittest'.
gotcha Package has no README. Lack of documentation may complicate usage.
fix Review source code for API details.
npm install unittest
yarn add unittest
pnpm add unittest

Basic usage: create a TestRunner, add a TestCase with an assertion, and run.

import { TestRunner, TestCase, assert } from 'unittest';

const runner = new TestRunner();
const test = new TestCase('example', () => {
  assert.equal(1 + 1, 2);
});
runner.add(test);
runner.run();
console.log('Tests passed.');