logo

tape-lite

tape shim based on node:test+node:assert with no dependencies
commit: fba2cb52ed2d9ee243f189e61f454e1ead89834c
parent 10dc5b15f0cbdecf950b2b4c5164789f6fcd6828
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 16 Sep 2023 17:23:56 +0200

index.js: Note all documented APIs from tape

Diffstat:

Mindex.js67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 63 insertions(+), 4 deletions(-)

diff --git a/index.js b/index.js @@ -16,25 +16,75 @@ module.exports = function(name, opts, cb) { function setup_cb(t) { const assert = require('node:assert/strict'); + // t.plan(n) + + // t.end(err) + + // t.teardown(cb) + + // t.fail(msg) + + // t.pass(msg) + + // t.timeoutAfter(ms) + + // t.skip(msg) + // t.ok(value, msg) → assert.ok(value[, message]) + // Aliases: t.true(), t.assert() t.ok = assert.ok; t.true = assert.ok; t.assert = assert.ok; // t.notOk(value, msg) → assert.ok(!value[, message]) + // Aliases: t.false(), t.notok() t.notOk = notOk; t.false = notOk; t.notok = notOk; // t.error(err, msg) + // Aliases: t.ifError(), t.ifErr(), t.iferror() // t.equal(actual, expected, msg) → assert.equal(actual, expected[, message]) + // Aliases: t.equals(), t.isEqual(), t.strictEqual(), t.strictEquals(), t.is() t.equal = assert.equal; t.equals = assert.equal; t.isEqual = assert.equal; t.strictEqual = assert.strictEqual; t.strictEquals = assert.strictEqual; t.is = assert.equal; + + // t.notEqual(actual, expected, msg) + // Aliases: t.notEquals(), t.isNotEqual(), t.doesNotEqual(), t.isInequal(), t.notStrictEqual(), t.notStrictEquals(), t.isNot(), t.not() + + // t.looseEqual(actual, expected, msg) + // Aliases: t.looseEquals() + + // t.notLooseEqual(actual, expected, msg) + // Aliases: t.notLooseEquals() + + // t.deepEqual(actual, expected, msg) + // Aliases: t.deepEquals(), t.isEquivalent(), t.same() + + // t.notDeepEqual(actual, expected, msg) + // Aliases: t.notDeepEquals, t.notEquivalent(), t.notDeeply(), t.notSame(), t.isNotDeepEqual(), t.isNotDeeply(), t.isNotEquivalent(), t.isInequivalent() + + // t.deepLooseEqual(actual, expected, msg) + + // t.notDeepLooseEqual(actual, expected, msg) + // Aliases: t.notLooseEqual(), t.notLooseEquals() + + // t.throws(fn, expected, msg) + + // t.doesNotThrow(fn, expected, msg) + + // t.test(name, [opts], cb) + + // t.comment(message) + + // t.match(string, regexp, message) + + // t.doesNotMatch(string, regexp, message) }; switch(arguments.length) { @@ -52,10 +102,19 @@ module.exports = function(name, opts, cb) { } }; -module.exports.onFinish = test.after(); -module.exports.plan = (n) => { - console.log("Notice: tape t.plan(", n, ") called"); -}; +// test.skip([name], [opts], cb) + +// test.onFinish(fn) +module.exports.onFinish = test.after; + +// test.onFailure(fn) module.exports.onFailure = (fn) => { onFailure.push(fn); + // TODO: Call each on event:fail }; + +// var htest = test.createHarness() + +// test.only([name], [opts], cb) + +// var stream = test.createStream(opts)