PR-URL: https://github.com/nodejs/node/pull/55036 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
18 lines
560 B
JavaScript
18 lines
560 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('node:assert');
|
|
const test = require('node:test');
|
|
|
|
const uncopiedKeys = [
|
|
'AssertionError',
|
|
'CallTracker',
|
|
'strict',
|
|
];
|
|
test('only methods from node:assert are on t.assert', (t) => {
|
|
const expectedKeys = Object.keys(assert).filter((key) => !uncopiedKeys.includes(key)).sort();
|
|
assert.deepStrictEqual(Object.keys(t.assert).sort(), expectedKeys);
|
|
});
|
|
|
|
test('t.assert.ok correctly parses the stacktrace', (t) => {
|
|
t.assert.throws(() => t.assert.ok(1 === 2), /t\.assert\.ok\(1 === 2\)/);
|
|
});
|