Skip to content

Commit

Permalink
v9 throws ENOTDIR when specifying a file as cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisblossom committed Jan 29, 2019
1 parent 71b9c58 commit 040e09d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,29 @@ 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 => {
t.plan(1);

const isFile = path.resolve('fixtures/gitignore/bar.js');

try {
await m('.', {cwd: isFile});
} catch (error) {
t.is('ENOTDIR', error.code);
}
});

// https://github.com/sindresorhus/globby/issues/105
test.failing('throws ENOTDIR when specifying a file as cwd - sync', t => {
t.plan(1);

const isFile = path.resolve('fixtures/gitignore/bar.js');

try {
m.sync('.', {cwd: isFile});
} catch (error) {
t.is('ENOTDIR', error.code);
}
});

0 comments on commit 040e09d

Please sign in to comment.