From bdbd97517122ce7de8a36ca5ce827f86003febf0 Mon Sep 17 00:00:00 2001 From: Mark Terrel Date: Wed, 2 Dec 2020 22:02:03 -0700 Subject: [PATCH] Remove faulty emulated ENOENT error on Windows (#447) --- index.js | 2 -- test/error.js | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index d94125310..c8739e454 100644 --- a/index.js +++ b/index.js @@ -147,8 +147,6 @@ const execa = (file, args, options) => { const handlePromiseOnce = onetime(handlePromise); - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - handleInput(spawned, parsed.options.input); spawned.all = makeAllStream(spawned, parsed.options); diff --git a/test/error.js b/test/error.js index 386c6508c..5c2013603 100644 --- a/test/error.js +++ b/test/error.js @@ -73,8 +73,8 @@ test('error.shortMessage does not contain stdout/stderr', async t => { }); test('Original error.message is kept', async t => { - const {originalMessage} = await t.throwsAsync(execa('wrong command')); - t.is(originalMessage, 'spawn wrong command ENOENT'); + const {originalMessage} = await t.throwsAsync(execa('noop', {cwd: 1})); + t.true(originalMessage.startsWith('The "options.cwd" property must be of type string. Received type number')); }); test('failed is false on success', async t => { @@ -205,6 +205,6 @@ test('error.code is undefined on success', async t => { }); test('error.code is defined on failure if applicable', async t => { - const {code} = await t.throwsAsync(execa('invalid')); - t.is(code, 'ENOENT'); + const {code} = await t.throwsAsync(execa('noop', {cwd: 1})); + t.is(code, 'ERR_INVALID_ARG_TYPE'); });