logo

tape-lite

tape shim based on node:test+node:assert with no dependencies
commit: 567500ee332b521b50374307f73179e8d9c016ca
parent 16e15c803713209f133dcd1dfbd323cdb937f214
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 21 Sep 2023 12:31:29 +0200

Add rest of easy to map functions

Diffstat:

Mindex.js93++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 66 insertions(+), 27 deletions(-)

diff --git a/index.js b/index.js @@ -22,58 +22,95 @@ module.exports = function(name, opts, cb) { // t.teardown(cb) // t.fail(msg) + t.fail = assert.fail; - // t.pass(msg) + // t.pass(msg) → context.skip([message]) + // technically not the same thing but close enough + t.pass = t.skip; // t.timeoutAfter(ms) - // t.skip(msg) + // t.skip(msg) → context.skip([message]) // 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.true = t.ok; + t.assert = t.ok; // t.notOk(value, msg) → assert.ok(!value[, message]) // Aliases: t.false(), t.notok() t.notOk = notOk; - t.false = notOk; - t.notok = notOk; + t.false = t.notOk; + t.notok = t.notOk; - // t.error(err, msg) + // t.error(err, msg) → assert.ifError(value) // Aliases: t.ifError(), t.ifErr(), t.iferror() + t.error = (err, msg) => assert.ifError(err); + t.ifError = t.error; + t.ifErr = t.error; + t.iferror = t.error; // 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) + t.equal = assert.strictEqual; + t.equals = t.equal; + t.isEqual = t.equal; + t.strictEqual = t.equal; + t.strictEquals = t.equal; + t.is = t.equal; + + // t.notEqual(actual, expected, msg) → assert.notStrictEqual(actual, expected[, message]) // Aliases: t.notEquals(), t.isNotEqual(), t.doesNotEqual(), t.isInequal(), t.notStrictEqual(), t.notStrictEquals(), t.isNot(), t.not() - - // t.looseEqual(actual, expected, msg) + t.notEqual = assert.notStrictEqual; + t.notEquals = t.notEqual; + t.doesNotEqual = t.notEqual; + t.isInequal = t.notEqual; + t.notStrictEqual = t.notEqual; + t.notStrictEquals = t.notEqual; + t.isNot = t.notEqual; + t.not = t.notEqual; + + // t.looseEqual(actual, expected, msg) → assert.Equal(actual, expected[, message]) // Aliases: t.looseEquals() + t.looseEqual = assert.Equal; + t.looseEquals = t.looseEqual; - // t.notLooseEqual(actual, expected, msg) + // t.notLooseEqual(actual, expected, msg) → assert.notEqual(actual, expected[, message]) // Aliases: t.notLooseEquals() + t.notLooseEqual = assert.notEqual; + t.notLooseEquals = t.notLooseEqual; - // t.deepEqual(actual, expected, msg) + // t.deepEqual(actual, expected, msg) → assert.deepStrictEqual(actual, expected[, message]) // Aliases: t.deepEquals(), t.isEquivalent(), t.same() + t.deepEqual = assert.deepStrictEqual; + t.deepEquals = t.deepEqual; + t.isEquivalent = t.deepEqual; + t.same = t.deepEqual; - // t.notDeepEqual(actual, expected, msg) + // t.notDeepEqual(actual, expected, msg) → assert.notDeepStrictEqual(actual, expected[, message]) // 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) + t.notDeepEqual = assert.notDeepStrictEqual; + t.notDeepEquals = t.notDeepEqual; + t.notEquivalent = t.notDeepEqual; + t.notDeeply = t.notDeepEqual; + t.notSame = t.notDeepEqual; + t.isNotDeepEqual = t.notDeepEqual; + t.isNotDeeply = t.notDeepEqual; + t.isNotEquivalent = t.notDeepEqual; + t.isInequivalent = t.notDeepEqual; + + // t.deepLooseEqual(actual, expected, msg) → assert.deepEqual(actual, expected[, message]) + t.deepLooseEqual = assert.deepEqual; + + // t.notDeepLooseEqual(actual, expected, msg) → assert.notDeepEqual(actual, expected[, message]) // Aliases: t.notLooseEqual(), t.notLooseEquals() + t.notDeepLooseEqual = assert.notDeepEqual; + t.notLooseEqual = t.notDeepLooseEqual; + t.notLooseEquals = t.notDeepLooseEqual; - // t.throws(fn, expected, msg) + // t.throws(fn, expected, msg) → assert.throws(fn[, error][, message]) + t.throws = assert.throws; // t.doesNotThrow(fn, expected, msg) @@ -81,9 +118,11 @@ module.exports = function(name, opts, cb) { // t.comment(message) - // t.match(string, regexp, message) + // t.match(string, regexp, message) → assert.match(string, regexp[, message]) + t.match = assert.match; - // t.doesNotMatch(string, regexp, message) + // t.doesNotMatch(string, regexp, message) → assert.doesNotMatch(string, regexp[, message]) + t.doesNotMatch = assert.doesNotMatch; }; switch(arguments.length)