mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: make test-runner-assert
more robust
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>
This commit is contained in:
parent
1c61a83444
commit
8b70e6bdee
@ -1,28 +1,16 @@
|
||||
'use strict';
|
||||
require('../common');
|
||||
const { deepStrictEqual } = require('node:assert');
|
||||
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) => {
|
||||
deepStrictEqual(Object.keys(t.assert).sort(), [
|
||||
'deepEqual',
|
||||
'deepStrictEqual',
|
||||
'doesNotMatch',
|
||||
'doesNotReject',
|
||||
'doesNotThrow',
|
||||
'equal',
|
||||
'fail',
|
||||
'ifError',
|
||||
'match',
|
||||
'notDeepEqual',
|
||||
'notDeepStrictEqual',
|
||||
'notEqual',
|
||||
'notStrictEqual',
|
||||
'ok',
|
||||
'rejects',
|
||||
'strictEqual',
|
||||
'throws',
|
||||
]);
|
||||
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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user