From d77a623a5d397260d952c84830c0240955ece808 Mon Sep 17 00:00:00 2001 From: Chris Blossom Date: Fri, 15 Feb 2019 21:25:31 -0800 Subject: [PATCH] Add failing test for #105 (#108) --- test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test.js b/test.js index 211ee8a..8579ce6 100644 --- a/test.js +++ b/test.js @@ -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'}); +});