From ea296858f334a7f26d3ce143b27e88671b09477e Mon Sep 17 00:00:00 2001 From: Chris Blossom Date: Tue, 15 Jan 2019 10:56:56 -0800 Subject: [PATCH] add failing test for #105 --- test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test.js b/test.js index 614dede..cfe00cd 100644 --- a/test.js +++ b/test.js @@ -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'}); +});