TAP for es modules
So you can write tests that will work in node and the browser without a build step.
Minimal API coverage, very similar to node-tap and tape but does not attempt to be 100% drop-in compatible.
import tap from 'tap-esm'
tap('this is a test', t => {
t.plan(1)
t.equal('a', 'b')
})
tap('this is an unplanned async test that ends automatically', async t => {
t.ok(true)
t.notOk(false)
})
Declares that n
assertions should be run. t.end()
will be called automatically after the nth assertion. If there are any more assertions after the nth, or after t.end()
is called, they will generate errors.
Declares the end of a test explicitly.
Generates a passing assertion with optional message.
Generates a failing assertion.
Asserts that value
is truthy.
Inverse of t.ok()
.
Asserts that actual
and expected
are strictly equal.
Inverse of t.equal()
.
Wraps actual
and expected
with Array.from()
and then asserts the resulting lengths and all contained items are strictly equal. Note that this method does not recurse nested arrays.
Inverse of t.arrayEqual()
.
http://testanything.org/
https://github.com/tapjs/node-tap
https://github.com/substack/tape
MIT