diff --git a/package.json b/package.json index b63dfd004c..2b2ca3c8fe 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "devDependencies": { "@types/node": "^11.12.2", "ava": "^1.4.1", - "cat-names": "^2.0.0", "coveralls": "^3.0.3", "delay": "^4.1.0", "is-running": "^2.1.0", diff --git a/test.js b/test.js index 2cb3095348..3f0f21f12b 100644 --- a/test.js +++ b/test.js @@ -184,19 +184,10 @@ test('stripFinalNewline option', async t => { t.is(stdout, 'foo\n'); }); -test.serial('preferLocal option', async t => { - t.true((await execa('cat-names')).stdout.length > 2); - - if (process.platform === 'win32') { - // TODO: figure out how to make the below not hang on Windows - return; - } - - // Account for npm adding local binaries to the PATH - const _path = process.env.PATH; - process.env.PATH = ''; - await t.throwsAsync(execa('cat-names', {preferLocal: false}), /spawn .* ENOENT/); - process.env.PATH = _path; +test('preferLocal option', async t => { + await execa('ava', ['--version'], {env: {PATH: ''}}); + const errorRegExp = process.platform === 'win32' ? /not recognized/ : /spawn ava ENOENT/; + await t.throwsAsync(execa('ava', ['--version'], {preferLocal: false, env: {PATH: ''}}), errorRegExp); }); test.serial('localDir option', async t => {