Skip to content

Commit d77a623

Browse files
chrisblossomsindresorhus
authored andcommitted
Add failing test for #105 (#108)
1 parent 2294618 commit d77a623

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,21 @@ test.failing('`{extension: false}` and `expandDirectories.extensions` option', t
236236
]
237237
);
238238
});
239+
240+
// https://github.com/sindresorhus/globby/issues/105
241+
test.failing('throws ENOTDIR when specifying a file as cwd - async', async t => {
242+
const isFile = path.resolve('fixtures/gitignore/bar.js');
243+
await t.throwsAsync(m('.', {cwd: isFile}), {code: 'ENOTDIR'});
244+
await t.throwsAsync(m('*', {cwd: isFile}), {code: 'ENOTDIR'});
245+
});
246+
247+
// https://github.com/sindresorhus/globby/issues/105
248+
test.failing('throws ENOTDIR when specifying a file as cwd - sync', t => {
249+
const isFile = path.resolve('fixtures/gitignore/bar.js');
250+
t.throws(() => {
251+
m.sync('.', {cwd: isFile});
252+
}, {code: 'ENOTDIR'});
253+
t.throws(() => {
254+
m.sync('*', {cwd: isFile});
255+
}, {code: 'ENOTDIR'});
256+
});

0 commit comments

Comments
 (0)