-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
Expand file tree
/
Copy pathtest-runner-issue-50397.js
More file actions
29 lines (26 loc) · 981 Bytes
/
test-runner-issue-50397.js
File metadata and controls
29 lines (26 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
// Regression test for https://github.com/nodejs/node/issues/50397:
// ensure --test preserves AssertionError actual type across isolation modes.
require('../common');
const { spawnSyncAndAssert } = require('../common/child_process');
const assert = require('node:assert');
const fixtures = require('../common/fixtures');
for (const isolation of ['none', 'process']) {
const args = [
'--test',
'--test-reporter=spec',
`--test-isolation=${isolation}`,
fixtures.path('test-runner/issue-50397/prototype-mismatch.js'),
];
spawnSyncAndAssert(process.execPath, args, {
status: 1,
signal: null,
stderr: '',
stdout(output) {
// Spec reporter output varies between inspect forms; accept both while
// still requiring the restored constructor name.
assert.match(output, /actual:\s+(?:\[ExtendedArray\]|ExtendedArray\(1\)\s+\[\s*'hello'\s*\])/);
assert.doesNotMatch(output, /actual:\s+\[Array\]/);
},
});
}