Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add failing test for #105 #108

Merged
merged 2 commits into from
Feb 16, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add failing test for #105
  • Loading branch information
chrisblossom committed Feb 15, 2019
commit ea296858f334a7f26d3ce143b27e88671b09477e
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'});
});