@@ -2,23 +2,28 @@ import '../common/index.mjs';
2
2
import * as fixtures from '../common/fixtures.mjs' ;
3
3
import * as snapshot from '../common/assertSnapshot.js' ;
4
4
import { describe , it } from 'node:test' ;
5
+ import { basename } from 'node:path' ;
5
6
6
7
function replaceNodeVersion ( str ) {
7
8
return str . replaceAll ( process . version , '*' ) ;
8
9
}
9
10
11
+ function replaceExecName ( str ) {
12
+ const baseName = basename ( process . argv0 || 'node' , '.exe' ) ;
13
+ return str . replaceAll ( `${ baseName } --` , '* --' ) ;
14
+ }
15
+
10
16
describe ( 'v8 output' , { concurrency : ! process . env . TEST_PARALLEL } , ( ) => {
11
17
function normalize ( str ) {
12
18
return str . replaceAll ( snapshot . replaceWindowsPaths ( process . cwd ( ) ) , '' )
13
19
. replaceAll ( / : \d + / g, ':*' )
14
20
. replaceAll ( '/' , '*' )
15
21
. replaceAll ( '*test*' , '*' )
16
22
. 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*' , '*' ) ;
19
24
}
20
25
const common = snapshot
21
- . transform ( snapshot . replaceWindowsLineEndings , snapshot . replaceWindowsPaths , replaceNodeVersion ) ;
26
+ . transform ( snapshot . replaceWindowsLineEndings , snapshot . replaceWindowsPaths , replaceNodeVersion , replaceExecName ) ;
22
27
const defaultTransform = snapshot . transform ( common , normalize ) ;
23
28
const tests = [
24
29
{ name : 'v8/v8_warning.js' } ,
0 commit comments