diff --git a/test/parallel/test-runner-assert.js b/test/parallel/test-runner-assert.js index 51c6ee67ebe4d3..8052a0fd84ac32 100644 --- a/test/parallel/test-runner-assert.js +++ b/test/parallel/test-runner-assert.js @@ -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) => {