File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,34 @@ import test from '@ava/test';
55import { fixture } from '../helpers/exec.js' ;
66
77const 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 ) a t .* \n / g, '$1at ---\n' ) ;
1515
16+ if ( / ^ 2 2 \. / . 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
You can’t perform that action at this time.
0 commit comments