Skip to content

Commit

Permalink
Add failing test for #105 (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisblossom authored and sindresorhus committed Feb 16, 2019
1 parent 2294618 commit d77a623
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test.js
Expand Up @@ -236,3 +236,21 @@ test.failing('`{extension: false}` and `expandDirectories.extensions` option', t
]
);
});

// 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 d77a623

Please sign in to comment.