@@ -2,23 +2,28 @@ import '../common/index.mjs';
22import * as fixtures from '../common/fixtures.mjs' ;
33import * as snapshot from '../common/assertSnapshot.js' ;
44import { describe , it } from 'node:test' ;
5+ import { basename } from 'node:path' ;
56
67function replaceNodeVersion ( str ) {
78 return str . replaceAll ( process . version , '*' ) ;
89}
910
11+ function replaceExecName ( str ) {
12+ const baseName = basename ( process . argv0 || 'node' , '.exe' ) ;
13+ return str . replaceAll ( `${ baseName } --` , '* --' ) ;
14+ }
15+
1016describe ( 'v8 output' , { concurrency : ! process . env . TEST_PARALLEL } , ( ) => {
1117 function normalize ( str ) {
1218 return str . replaceAll ( snapshot . replaceWindowsPaths ( process . cwd ( ) ) , '' )
1319 . replaceAll ( / : \d + / g, ':*' )
1420 . replaceAll ( '/' , '*' )
1521 . replaceAll ( '*test*' , '*' )
1622 . replaceAll ( / .* ?\* f i x t u r e s \* v 8 \* / g, '(node:*) V8: *' ) // Replace entire path before fixtures/v8
17- . replaceAll ( '*fixtures*v8*' , '*' )
18- . replaceAll ( 'node --' , '* --' ) ;
23+ . replaceAll ( '*fixtures*v8*' , '*' ) ;
1924 }
2025 const common = snapshot
21- . transform ( snapshot . replaceWindowsLineEndings , snapshot . replaceWindowsPaths , replaceNodeVersion ) ;
26+ . transform ( snapshot . replaceWindowsLineEndings , snapshot . replaceWindowsPaths , replaceNodeVersion , replaceExecName ) ;
2227 const defaultTransform = snapshot . transform ( common , normalize ) ;
2328 const tests = [
2429 { name : 'v8/v8_warning.js' } ,
0 commit comments