-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
tape-six
is a TAP-based library for unit tests.
It is written in the modern JavaScript for the modern JavaScript and works in Node,
Deno, Bun and browsers.
It uses a familiar API for unit testing and supports browser-based and command-line testing, debugging and visualizing results.
- Install
tape-six
in your project:npm i -D tape-six
. - Write tests (see below).
- Configure your tests: set-up tests.
- Run tests:
npm test
(see tape6).
Example:
import test from 'tape-six';
test('Sample test', t => {
t.ok(1 < 2, '1 is less than 2');
t.deepEqual([1], [1], '[1] is equal to [1]');
});
To register a function as a test, use the test() function.
That function is called with a tester object as the first argument. See Tester for details.
Test files are directly executable with node
or deno
or bun
or in a browser.
Yet for a superior developer experience, a number of utilities are available:
- tape6 for running tests.
- tape6-server for serving files and running tests in a web server.
- tape6-runner for helping writing custom shell scripts.
Check out the sister project: tape-six-proc — it runs tests in separate processes.
tape-six
is used in different environments:
The project is distributed under the 3-clause BSD license.
Other pertinent information: