@@ -32,15 +32,15 @@ test('"preferLocal: false", "addExecPath: false" does not add node_modules/.bin
32
32
33
33
test ( 'the `cwd` option changes the current directory' , t => {
34
34
t . is (
35
- npmRunPath ( { path : '' , cwd : '/dir' } ) . split ( path . delimiter ) [ 0 ] ,
36
- path . normalize ( ' /dir/node_modules/.bin') ,
35
+ npmRunPath ( { path : '' , cwd : '. /dir' } ) . split ( path . delimiter ) [ 0 ] ,
36
+ path . resolve ( '. /dir/node_modules/.bin') ,
37
37
) ;
38
38
} ) ;
39
39
40
40
test ( 'the `cwd` option can be a file URL' , t => {
41
41
t . is (
42
- npmRunPath ( { path : '' , cwd : new URL ( 'file:/// dir' ) } ) . split ( path . delimiter ) [ 0 ] ,
43
- path . normalize ( '/ dir/node_modules/.bin') ,
42
+ npmRunPath ( { path : '' , cwd : new URL ( 'dir' , import . meta . url ) } ) . split ( path . delimiter ) [ 0 ] ,
43
+ fileURLToPath ( new URL ( ' dir/node_modules/.bin', import . meta . url ) ) ,
44
44
) ;
45
45
} ) ;
46
46
@@ -88,7 +88,7 @@ test('the `execPath` option is relative to the `cwd` option', t => {
88
88
const pathEnv = npmRunPath ( {
89
89
path : '' ,
90
90
execPath : 'test/test' ,
91
- cwd : '/dir' ,
91
+ cwd : '. /dir' ,
92
92
} ) . split ( path . delimiter ) ;
93
- t . is ( pathEnv . at ( - 2 ) , path . normalize ( ' /dir/test') ) ;
93
+ t . is ( pathEnv . at ( - 2 ) , path . resolve ( '. /dir/test') ) ;
94
94
} ) ;
0 commit comments