mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
PR-URL: https://github.com/nodejs/node/pull/54776 Refs: https://github.com/nodejs/help/issues/4461 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
31 lines
684 B
JavaScript
31 lines
684 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const { deepStrictEqual } = require('node:assert');
|
|
const test = require('node:test');
|
|
|
|
test('only methods from node:assert are on t.assert', (t) => {
|
|
deepStrictEqual(Object.keys(t.assert).sort(), [
|
|
'deepEqual',
|
|
'deepStrictEqual',
|
|
'doesNotMatch',
|
|
'doesNotReject',
|
|
'doesNotThrow',
|
|
'equal',
|
|
'fail',
|
|
'ifError',
|
|
'match',
|
|
'notDeepEqual',
|
|
'notDeepStrictEqual',
|
|
'notEqual',
|
|
'notStrictEqual',
|
|
'ok',
|
|
'rejects',
|
|
'strictEqual',
|
|
'throws',
|
|
]);
|
|
});
|
|
|
|
test('t.assert.ok correctly parses the stacktrace', (t) => {
|
|
t.assert.throws(() => t.assert.ok(1 === 2), /t\.assert\.ok\(1 === 2\)/);
|
|
});
|