@@ -243,20 +243,28 @@ test.failing('`{extension: false}` and `expandDirectories.extensions` option', t
243
243
) ;
244
244
} ) ;
245
245
246
- // https://github.com/sindresorhus/globby/issues/105
247
- test . failing ( 'throws ENOTDIR when specifying a file as cwd - async' , async t => {
246
+ test ( 'throws when specifying a file as cwd - async' , async t => {
248
247
const isFile = path . resolve ( 'fixtures/gitignore/bar.js' ) ;
249
- await t . throwsAsync ( globby ( '.' , { cwd : isFile } ) , { code : 'ENOTDIR' } ) ;
250
- await t . throwsAsync ( globby ( '*' , { cwd : isFile } ) , { code : 'ENOTDIR' } ) ;
248
+
249
+ await t . throwsAsync (
250
+ globby ( '.' , { cwd : isFile } ) ,
251
+ 'The `cwd` option must be a path to a directory'
252
+ ) ;
253
+
254
+ await t . throwsAsync (
255
+ globby ( '*' , { cwd : isFile } ) ,
256
+ 'The `cwd` option must be a path to a directory'
257
+ ) ;
251
258
} ) ;
252
259
253
- // https://github.com/sindresorhus/globby/issues/105
254
- test . failing ( 'throws ENOTDIR when specifying a file as cwd - sync' , t => {
260
+ test ( 'throws when specifying a file as cwd - sync' , t => {
255
261
const isFile = path . resolve ( 'fixtures/gitignore/bar.js' ) ;
262
+
256
263
t . throws ( ( ) => {
257
264
globby . sync ( '.' , { cwd : isFile } ) ;
258
- } , { code : 'ENOTDIR' } ) ;
265
+ } , 'The `cwd` option must be a path to a directory' ) ;
266
+
259
267
t . throws ( ( ) => {
260
268
globby . sync ( '*' , { cwd : isFile } ) ;
261
- } , { code : 'ENOTDIR' } ) ;
269
+ } , 'The `cwd` option must be a path to a directory' ) ;
262
270
} ) ;
0 commit comments