Skip to content
Myr

Remove faulty emulated ENOENT error on Windows (#447)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Mark Terrel · committed by GitHub · parent 2706b3f · Browse files · 2 files+4 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−6 removed

  • tests:+4 added−4 removed
  • other:+0 added−2 removed

2 files+4 added−6 removed

modified:test/error.js+4 added-4 removed
71 unmodified lines
72 t.false(shortMessage.includes('stdout'));73});7475test('Original error.message is kept', async t => {76 const {originalMessage} = await t.throwsAsync(execa('wrong command'));77 t.is(originalMessage, 'spawn wrong command ENOENT');76 const {originalMessage} = await t.throwsAsync(execa('noop', {cwd: 1}));77 t.true(originalMessage.startsWith('The "options.cwd" property must be of type string. Received type number'));78});7980test('failed is false on success', async t => {81 const {failed} = await execa('noop', ['foo']);
122 unmodified lines
204 t.is(code, undefined);205});206207test('error.code is defined on failure if applicable', async t => {208 const {code} = await t.throwsAsync(execa('invalid'));209 t.is(code, 'ENOENT');208 const {code} = await t.throwsAsync(execa('noop', {cwd: 1}));209 t.is(code, 'ERR_INVALID_ARG_TYPE');210});
modified:index.js-2 removed
145 unmodified lines
146 };147148 const handlePromiseOnce = onetime(handlePromise);149150 crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);151150 handleInput(spawned, parsed.options.input);151152 spawned.all = makeAllStream(spawned, parsed.options);153
105 unmodified lines