Skip to content

Commit

Permalink
add failing test for #105
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisblossom committed Feb 15, 2019
1 parent 71b9c58 commit ea29685
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,17 @@ test('respects gitignore option false - sync', t => {
const actual = m.sync('*', {gitignore: false, onlyFiles: false});
t.true(actual.indexOf('node_modules') > -1);
});

// https://github.com/sindresorhus/globby/issues/105
test.failing('throws ENOTDIR when specifying a file as cwd - async', async t => {
const isFile = path.resolve('fixtures/gitignore/bar.js');
await t.throwsAsync(m('.', {cwd: isFile}), {code: 'ENOTDIR'});
await t.throwsAsync(m('*', {cwd: isFile}), {code: 'ENOTDIR'});
});

// https://github.com/sindresorhus/globby/issues/105
test.failing('throws ENOTDIR when specifying a file as cwd - sync', t => {
const isFile = path.resolve('fixtures/gitignore/bar.js');
t.throws(() => m.sync('.', {cwd: isFile}), {code: 'ENOTDIR'});
t.throws(() => m.sync('*', {cwd: isFile}), {code: 'ENOTDIR'});
});

0 comments on commit ea29685

Please sign in to comment.