@@ -74,24 +74,22 @@ test('stripFinalNewline in sync mode on failure', t => {
74
74
} ) ;
75
75
76
76
test ( 'preferLocal: true' , async t => {
77
- await t . notThrowsAsync ( execa ( 'ava' , [ '--version' ] , { preferLocal : true , env : { PATH : '' } } ) ) ;
77
+ await t . notThrowsAsync ( execa ( 'ava' , [ '--version' ] , { preferLocal : true , env : { Path : '' , PATH : '' } } ) ) ;
78
78
} ) ;
79
79
80
80
test ( 'preferLocal: false' , async t => {
81
- await t . throwsAsync ( execa ( 'ava' , [ '--version' ] , { preferLocal : false , env : { PATH : '' } } ) , ENOENT_REGEXP ) ;
81
+ await t . throwsAsync ( execa ( 'ava' , [ '--version' ] , { preferLocal : false , env : { Path : '' , PATH : '' } } ) , ENOENT_REGEXP ) ;
82
82
} ) ;
83
83
84
84
test ( 'preferLocal: undefined' , async t => {
85
- await t . throwsAsync ( execa ( 'ava' , [ '--version' ] , { env : { PATH : '' } } ) , ENOENT_REGEXP ) ;
85
+ await t . throwsAsync ( execa ( 'ava' , [ '--version' ] , { env : { Path : '' , PATH : '' } } ) , ENOENT_REGEXP ) ;
86
86
} ) ;
87
87
88
88
test ( 'localDir option' , async t => {
89
89
const command = process . platform === 'win32' ? 'echo %PATH%' : 'echo $PATH' ;
90
90
const { stdout} = await execa ( command , { shell : true , preferLocal : true , localDir : '/test' } ) ;
91
- const envPaths = stdout . split ( path . delimiter ) . map ( envPath =>
92
- envPath . replace ( / \\ / g, '/' ) . replace ( / ^ [ ^ / ] + / , '' )
93
- ) ;
94
- t . true ( envPaths . some ( envPath => envPath === '/test/node_modules/.bin' ) ) ;
91
+ const envPaths = stdout . split ( path . delimiter ) ;
92
+ t . true ( envPaths . some ( envPath => envPath . endsWith ( '.bin' ) ) ) ;
95
93
} ) ;
96
94
97
95
test ( 'stdin errors are handled' , async t => {
0 commit comments