Skip to content

Commit fc7cfbb

Browse files
committed
Fix?
1 parent bb2c0ca commit fc7cfbb

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/external-assertions/test.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,34 @@ import test from '@ava/test';
55
import {fixture} from '../helpers/exec.js';
66

77
const snapshotStdout = (t, stdout) => {
8-
const normalized = stdout
8+
let normalized = stdout
99
.replaceAll('\r', '')
1010
.replaceAll(/\/{3}/g, '//')
1111
// Not sure how, but this Symbol may different on different system
1212
// https://github.com/nodejs/node/blob/dec0213c834607e7721ee250d8c46ef9cd112efe/lib/internal/test_runner/reporter/utils.js#L21
1313
.replaceAll('× ', '✘ ')
1414
.replaceAll(/(\b)at.*\n/g, '$1at ---\n');
1515

16+
if (/^22\./.test(process.versions.node)) {
17+
console.log({normalized});
18+
normalized = normalized.replace(
19+
`
20+
The expression evaluated to a falsy value:
21+
22+
assert.ok(false)
23+
24+
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
25+
26+
assert.ok(false)
27+
`.split('\n').map(line => line ? ` ${line}` : '').join('\n'),
28+
`
29+
false == true
30+
31+
AssertionError [ERR_ASSERTION]: false == true
32+
`.split('\n').map(line => line ? ` ${line}` : '').join('\n'),
33+
);
34+
}
35+
1636
t.snapshot(normalized);
1737
};
1838

0 commit comments

Comments
 (0)