Skip to content
Myr

error.js

This file

Path

test/error.js

294 lines · 10.9 KiB · JavaScript

Last changed by

Fix `reject` option with early spawning errors (#734)ehmickybefore adoption8a18881

History of this file

Take it

The walk stopped after 200 commits: lines older than 0e4da68 point at it.

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 1why, one step back
1import process from 'node:process';

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 2why, one step back
2import test from 'ava';

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 3why, one step back
3import {execa, execaSync} from '../index.js';

Add `cwd` error property (#565)homersimpsonsbefore adoptionf57fdec

line 4why, one step back
4import {FIXTURES_DIR, setFixtureDir} from './helpers/fixtures-dir.js';

Improve `error.message` (#705)ehmickybefore adoption67b476b

line 5why, one step back
5import {fullStdio, getStdio} from './helpers/stdio.js';

Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce

line 6why, one step back
6import {noopGenerator, outputObjectGenerator} from './helpers/generator.js';

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 7why, one step back
7

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

line 8why, one step back
8const isWindows = process.platform === 'win32';

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 9why, one step back
9

Re-enable Windows in CI (#500)ehmickybefore adoption071d0a2

line 10why, one step back
10setFixtureDir();

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 11why, one step back
11

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 12–13why, one step back
12const TIMEOUT_REGEXP = /timed out after/;
13

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 14–16why, one step back
14const testEmptyErrorStdio = async (t, execaMethod) => {
15 const {failed, stdout, stderr, stdio} = await execaMethod('fail.js', {reject: false});16 t.true(failed);

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

lines 17–18why, one step back
17 t.is(stdout, '');
18 t.is(stderr, '');

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 19–20why, one step back
19 t.deepEqual(stdio, [undefined, '', '']);
20};

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 21why, one step back
21

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 22–23why, one step back
22test('empty error.stdout/stderr/stdio', testEmptyErrorStdio, execa);
23test('empty error.stdout/stderr/stdio - sync', testEmptyErrorStdio, execaSync);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 24why, one step back
24

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 25–30why, one step back
25const testUndefinedErrorStdio = async (t, execaMethod) => {
26 const {stdout, stderr, stdio} = await execaMethod('empty.js', {stdio: 'ignore'});27 t.is(stdout, undefined);28 t.is(stderr, undefined);29 t.deepEqual(stdio, [undefined, undefined, undefined]);30};

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 31why, one step back
31

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 32–43why, one step back
32test('undefined error.stdout/stderr/stdio', testUndefinedErrorStdio, execa);
33test('undefined error.stdout/stderr/stdio - sync', testUndefinedErrorStdio, execaSync);3435const testEmptyAll = async (t, options, expectedValue) => {36 const {all} = await t.throwsAsync(execa('fail.js', options));37 t.is(all, expectedValue);38};3940test('empty error.all', testEmptyAll, {all: true}, '');41test('undefined error.all', testEmptyAll, {}, undefined);42test('ignored error.all', testEmptyAll, {all: true, stdio: 'ignore'}, undefined);43

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

lines 44–45why, one step back
44test('empty error.stdio[0] even with input', async t => {
45 const {stdio} = await t.throwsAsync(execa('fail.js', {input: 'test'}));

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

line 46why, one step back
46 t.is(stdio[0], undefined);

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

lines 47–48why, one step back
47});
48

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 49–50why, one step back
49// `error.code` is OS-specific here
50const SPAWN_ERROR_CODES = new Set(['EINVAL', 'ENOTSUP', 'EPERM']);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 51why, one step back
51

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

line 52why, one step back
52test('stdout/stderr/stdio on process spawning errors', async t => {

Fix `reject` option with early spawning errors (#734)ehmickybefore adoption8a18881

line 53why, one step back
53 const {code, stdout, stderr, stdio} = await t.throwsAsync(execa('empty.js', {uid: -1}));

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 54–57why, one step back
54 t.true(SPAWN_ERROR_CODES.has(code));
55 t.is(stdout, undefined);56 t.is(stderr, undefined);57 t.deepEqual(stdio, [undefined, undefined, undefined]);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 58–59why, one step back
58});
59

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 60–61why, one step back
60test('stdout/stderr/all/stdio on process spawning errors - sync', t => {
61 const {code, stdout, stderr, stdio} = t.throws(() => {

Fix `reject` option with early spawning errors (#734)ehmickybefore adoption8a18881

line 62why, one step back
62 execaSync('empty.js', {uid: -1});

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 63why, one step back
63 });

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 64–67why, one step back
64 t.true(SPAWN_ERROR_CODES.has(code));
65 t.is(stdout, undefined);66 t.is(stderr, undefined);67 t.deepEqual(stdio, [undefined, undefined, undefined]);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 68–69why, one step back
68});
69

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 70–72why, one step back
70const testErrorOutput = async (t, execaMethod) => {
71 const {failed, stdout, stderr, stdio} = await execaMethod('echo-fail.js', {...fullStdio, reject: false});72 t.true(failed);

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

lines 73–74why, one step back
73 t.is(stdout, 'stdout');
74 t.is(stderr, 'stderr');

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 75–76why, one step back
75 t.deepEqual(stdio, [undefined, 'stdout', 'stderr', 'fd3']);
76};

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 77why, one step back
77

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 78–79why, one step back
78test('error.stdout/stderr/stdio is defined', testErrorOutput, execa);
79test('error.stdout/stderr/stdio is defined - sync', testErrorOutput, execaSync);

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 80why, one step back
80

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 81why, one step back
81test('exitCode is 0 on success', async t => {

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 82why, one step back
82 const {exitCode} = await execa('noop.js', ['foo']);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 83–85why, one step back
83 t.is(exitCode, 0);
84});85

Upgrade dependenciesSindre Sorhusbefore adoption5d64878

line 86why, one step back
86const testExitCode = async (t, number) => {

Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe

lines 87–90why, one step back
87 const {exitCode} = await t.throwsAsync(
88 execa('exit.js', [`${number}`]),89 {message: new RegExp(`failed with exit code ${number}`)},90 );

Upgrade dependenciesSindre Sorhusbefore adoption5d64878

line 91why, one step back
91 t.is(exitCode, number);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 92–98why, one step back
92};
9394test('exitCode is 2', testExitCode, 2);95test('exitCode is 3', testExitCode, 3);96test('exitCode is 4', testExitCode, 4);9798test('error.message contains the command', async t => {

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 99why, one step back
99 await t.throwsAsync(execa('exit.js', ['2', 'foo', 'bar']), {message: /exit.js 2 foo bar/});

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 100–101why, one step back
100});
101

Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce

lines 102–103why, one step back
102const testStdioMessage = async (t, encoding, all, objectMode) => {
103 const {message} = await t.throwsAsync(execa('echo-fail.js', {...getStdio(1, noopGenerator(objectMode), 4), encoding, all}));

Improve `error.message` (#705)ehmickybefore adoption67b476b

lines 104–105why, one step back
104 const output = all ? 'stdout\nstderr' : 'stderr\n\nstdout';
105 t.true(message.endsWith(`echo-fail.js\n\n${output}\n\nfd3`));

Fix `error.message` when using `encoding: 'buffer'` (#701)ehmickybefore adoptionb8c1f55

lines 106–107why, one step back
106};
107

Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce

lines 108–115why, one step back
108test('error.message contains stdout/stderr/stdio if available', testStdioMessage, 'utf8', false, false);
109test('error.message contains stdout/stderr/stdio even with encoding "buffer"', testStdioMessage, 'buffer', false, false);110test('error.message contains all if available', testStdioMessage, 'utf8', true, false);111test('error.message contains all even with encoding "buffer"', testStdioMessage, 'buffer', true, false);112test('error.message contains stdout/stderr/stdio if available, objectMode', testStdioMessage, 'utf8', false, true);113test('error.message contains stdout/stderr/stdio even with encoding "buffer", objectMode', testStdioMessage, 'buffer', false, true);114test('error.message contains all if available, objectMode', testStdioMessage, 'utf8', true, true);115test('error.message contains all even with encoding "buffer", objectMode', testStdioMessage, 'buffer', true, true);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 116why, one step back
116

Improve `error.message` (#705)ehmickybefore adoption67b476b

lines 117–120why, one step back
117const testPartialIgnoreMessage = async (t, index, stdioOption, output) => {
118 const {message} = await t.throwsAsync(execa('echo-fail.js', getStdio(index, stdioOption, 4)));119 t.true(message.endsWith(`echo-fail.js\n\n${output}\n\nfd3`));120};

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 121why, one step back
121

Improve `error.message` (#705)ehmickybefore adoption67b476b

lines 122–123why, one step back
122test('error.message does not contain stdout if not available', testPartialIgnoreMessage, 1, 'ignore', 'stderr');
123test('error.message does not contain stderr if not available', testPartialIgnoreMessage, 2, 'ignore', 'stdout');

Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce

lines 124–125why, one step back
124test('error.message does not contain stdout if it is an object', testPartialIgnoreMessage, 1, outputObjectGenerator, 'stderr');
125test('error.message does not contain stderr if it is an object', testPartialIgnoreMessage, 2, outputObjectGenerator, 'stdout');

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 126why, one step back
126

Improve `error.message` (#705)ehmickybefore adoption67b476b

lines 127–128why, one step back
127const testFullIgnoreMessage = async (t, options, resultProperty) => {
128 const {[resultProperty]: message} = await t.throwsAsync(execa('echo-fail.js', options));

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 129–130why, one step back
129 t.false(message.includes('stderr'));
130 t.false(message.includes('stdout'));

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 131why, one step back
131 t.false(message.includes('fd3'));

Improve `error.message` (#705)ehmickybefore adoption67b476b

line 132why, one step back
132};

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 133why, one step back
133

Improve `error.message` (#705)ehmickybefore adoption67b476b

lines 134–143why, one step back
134test('error.message does not contain stdout/stderr/stdio if not available', testFullIgnoreMessage, {stdio: 'ignore'}, 'message');
135test('error.shortMessage does not contain stdout/stderr/stdio', testFullIgnoreMessage, fullStdio, 'shortMessage');136137const testErrorMessageConsistent = async (t, stdout) => {138 const {message} = await t.throwsAsync(execa('noop-both-fail.js', [stdout, 'stderr']));139 t.true(message.endsWith(`noop-both-fail.js ${stdout} stderr\n\nstderr\n\nstdout`));140};141142test('error.message newlines are consistent - no newline', testErrorMessageConsistent, 'stdout');143test('error.message newlines are consistent - newline', testErrorMessageConsistent, 'stdout\n');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 144–145why, one step back
144
145test('Original error.message is kept', async t => {

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 146why, one step back
146 const {originalMessage} = await t.throwsAsync(execa('noop.js', {cwd: 1}));

Drop support for Node 12 (#497)ehmickybefore adoptiona09cbc0

line 147why, one step back
147 t.true(originalMessage.startsWith('The "options.cwd" property must be of type string or an instance of Buffer or URL. Received type number'));

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 148–150why, one step back
148});
149150test('failed is false on success', async t => {

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 151why, one step back
151 const {failed} = await execa('noop.js', ['foo']);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 152–155why, one step back
152 t.false(failed);
153});154155test('failed is true on failure', async t => {

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 156why, one step back
156 const {failed} = await t.throwsAsync(execa('fail.js'));

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 157–159why, one step back
157 t.true(failed);
158});159

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

line 160why, one step back
160test('error.isTerminated is true if process was killed directly', async t => {

Improve `killSignal` option (#728)ehmickybefore adoptioncf36c1d

line 161why, one step back
161 const subprocess = execa('forever.js', {killSignal: 'SIGINT'});

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 162–164why, one step back
162
163 subprocess.kill();164

Improve `killSignal` option (#728)ehmickybefore adoptioncf36c1d

line 165why, one step back
165 const {isTerminated, signal} = await t.throwsAsync(subprocess, {message: /was killed with SIGINT/});

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

line 166why, one step back
166 t.true(isTerminated);

Improve `killSignal` option (#728)ehmickybefore adoptioncf36c1d

line 167why, one step back
167 t.is(signal, 'SIGINT');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 168–169why, one step back
168});
169

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

line 170why, one step back
170test('error.isTerminated is true if process was killed indirectly', async t => {

Improve `killSignal` option (#728)ehmickybefore adoptioncf36c1d

line 171why, one step back
171 const subprocess = execa('forever.js', {killSignal: 'SIGHUP'});

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 172–175why, one step back
172
173 process.kill(subprocess.pid, 'SIGINT');174175 // `process.kill()` is emulated by Node.js on Windows

Improve process termination (#724)ehmickybefore adoption1c48d37

lines 176–184why, one step back
176 if (isWindows) {
177 const {isTerminated, signal} = await t.throwsAsync(subprocess, {message: /failed with exit code 1/});178 t.is(isTerminated, false);179 t.is(signal, undefined);180 } else {181 const {isTerminated, signal} = await t.throwsAsync(subprocess, {message: /was killed with SIGINT/});182 t.is(isTerminated, true);183 t.is(signal, 'SIGINT');184 }

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 185–186why, one step back
185});
186

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

lines 187–189why, one step back
187test('result.isTerminated is false if not killed', async t => {
188 const {isTerminated} = await execa('noop.js');189 t.false(isTerminated);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 190–191why, one step back
190});
191

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

lines 192–197why, one step back
192test('result.isTerminated is false if not killed and childProcess.kill() was called', async t => {
193 const subprocess = execa('noop.js');194 subprocess.kill(0);195 t.true(subprocess.killed);196 const {isTerminated} = await subprocess;197 t.false(isTerminated);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 198–199why, one step back
198});
199

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

lines 200–202why, one step back
200test('result.isTerminated is false if not killed, in sync mode', t => {
201 const {isTerminated} = execaSync('noop.js');202 t.false(isTerminated);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 203–204why, one step back
203});
204

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

lines 205–211why, one step back
205test('result.isTerminated is false on process error', async t => {
206 const {isTerminated} = await t.throwsAsync(execa('wrong command'));207 t.false(isTerminated);208});209210test('result.isTerminated is false on process error, in sync mode', t => {211 const {isTerminated} = t.throws(() => {

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 212why, one step back
212 execaSync('wrong command');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 213why, one step back
213 });

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

line 214why, one step back
214 t.false(isTerminated);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 215–216why, one step back
215});
216

Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c

line 217why, one step back
217if (!isWindows) {

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 218why, one step back
218 test('error.signal is SIGINT', async t => {

Fix randomly failing tests for `spawned.kill()` (#613)ehmickybefore adoption43c30ac

line 219why, one step back
219 const subprocess = execa('forever.js');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 220–227why, one step back
220
221 process.kill(subprocess.pid, 'SIGINT');222223 const {signal} = await t.throwsAsync(subprocess, {message: /was killed with SIGINT/});224 t.is(signal, 'SIGINT');225 });226227 test('error.signalDescription is defined', async t => {

Fix randomly failing tests for `spawned.kill()` (#613)ehmickybefore adoption43c30ac

line 228why, one step back
228 const subprocess = execa('forever.js');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 229–236why, one step back
229
230 process.kill(subprocess.pid, 'SIGINT');231232 const {signalDescription} = await t.throwsAsync(subprocess, {message: /User interruption with CTRL-C/});233 t.is(signalDescription, 'User interruption with CTRL-C');234 });235236 test('error.signal is SIGTERM', async t => {

Fix randomly failing tests for `spawned.kill()` (#613)ehmickybefore adoption43c30ac

line 237why, one step back
237 const subprocess = execa('forever.js');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 238–244why, one step back
238
239 process.kill(subprocess.pid, 'SIGTERM');240241 const {signal} = await t.throwsAsync(subprocess, {message: /was killed with SIGTERM/});242 t.is(signal, 'SIGTERM');243 });244

Improve `killSignal` option (#728)ehmickybefore adoptioncf36c1d

lines 245–247why, one step back
245 test('error.signal uses killSignal', async t => {
246 const {signal} = await t.throwsAsync(execa('forever.js', {killSignal: 'SIGINT', timeout: 1, message: TIMEOUT_REGEXP}));247 t.is(signal, 'SIGINT');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 248–250why, one step back
248 });
249250 test('exitCode is undefined on signal termination', async t => {

Fix randomly failing tests for `spawned.kill()` (#613)ehmickybefore adoption43c30ac

line 251why, one step back
251 const subprocess = execa('forever.js');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 252–260why, one step back
252
253 process.kill(subprocess.pid);254255 const {exitCode} = await t.throwsAsync(subprocess);256 t.is(exitCode, undefined);257 });258}259260test('result.signal is undefined for successful execution', async t => {

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 261why, one step back
261 const {signal} = await execa('noop.js');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 262–265why, one step back
262 t.is(signal, undefined);
263});264265test('result.signal is undefined if process failed, but was not killed', async t => {

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 266why, one step back
266 const {signal} = await t.throwsAsync(execa('fail.js'));

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 267–270why, one step back
267 t.is(signal, undefined);
268});269270test('result.signalDescription is undefined for successful execution', async t => {

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 271why, one step back
271 const {signalDescription} = await execa('noop.js');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 272–275why, one step back
272 t.is(signalDescription, undefined);
273});274275test('error.code is undefined on success', async t => {

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 276why, one step back
276 const {code} = await execa('noop.js');

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

lines 277–280why, one step back
277 t.is(code, undefined);
278});279280test('error.code is defined on failure if applicable', async t => {

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 281why, one step back
281 const {code} = await t.throwsAsync(execa('noop.js', {cwd: 1}));

Remove faulty emulated ENOENT error on Windows (#447)Mark Terrelbefore adoptionbdbd975

line 282why, one step back
282 t.is(code, 'ERR_INVALID_ARG_TYPE');

Add `cwd` error property (#565)homersimpsonsbefore adoptionf57fdec

lines 283–285why, one step back
283});
284285test('error.cwd is defined on failure if applicable', async t => {

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 286why, one step back
286 const {cwd} = await t.throwsAsync(execa('fail.js', [], {cwd: FIXTURES_DIR}));

Add `cwd` error property (#565)homersimpsonsbefore adoptionf57fdec

lines 287–291why, one step back
287 t.is(cwd, FIXTURES_DIR);
288});289290test('error.cwd is undefined on failure if not passed as options', async t => {291 const expectedCwd = process.cwd();

Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207

line 292why, one step back
292 const {cwd} = await t.throwsAsync(execa('fail.js'));

Add `cwd` error property (#565)homersimpsonsbefore adoptionf57fdec

line 293why, one step back
293 t.is(cwd, expectedCwd);

Simplify `mergePromise` function (#403)fisker Cheungbefore adoption0e4da68

line 294why, one step back
294});