Skip to content

Commit 43bbca2

Browse files
avivkellertargos
authored andcommitted
test: make test-runner-assert more robust
PR-URL: #55036 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent 89aeae6 commit 43bbca2

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

test/parallel/test-runner-assert.js

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
'use strict';
22
require('../common');
3-
const { deepStrictEqual } = require('node:assert');
3+
const assert = require('node:assert');
44
const test = require('node:test');
55

6+
const uncopiedKeys = [
7+
'AssertionError',
8+
'CallTracker',
9+
'strict',
10+
];
611
test('only methods from node:assert are on t.assert', (t) => {
7-
deepStrictEqual(Object.keys(t.assert).sort(), [
8-
'deepEqual',
9-
'deepStrictEqual',
10-
'doesNotMatch',
11-
'doesNotReject',
12-
'doesNotThrow',
13-
'equal',
14-
'fail',
15-
'ifError',
16-
'match',
17-
'notDeepEqual',
18-
'notDeepStrictEqual',
19-
'notEqual',
20-
'notStrictEqual',
21-
'ok',
22-
'rejects',
23-
'strictEqual',
24-
'throws',
25-
]);
12+
const expectedKeys = Object.keys(assert).filter((key) => !uncopiedKeys.includes(key)).sort();
13+
assert.deepStrictEqual(Object.keys(t.assert).sort(), expectedKeys);
2614
});
2715

2816
test('t.assert.ok correctly parses the stacktrace', (t) => {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy