Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove faulty emulated ENOENT error on Windows #447

Merged
merged 1 commit into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions test/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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');
});