Skip to content
Myr

error.js

This file

Path

test/error.js

330 lines · 11.7 KiB · JavaScript

Last changed by

Fix `error.stack` with `stream.destroy(error)` (#814)ehmickybefore adoption07a9890

History of this file

Take it

The walk stopped after 200 commits: lines older than 2706b3f 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';

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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';

Improve `cwd` option (#803)ehmickybefore adoption2fd9351

line 4why, one step back
4import {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';

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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';

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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

Re-order return value properties (#801)ehmickybefore adoption72836f3

lines 14–18why, one step back
14test('Return value properties are not missing and are ordered', async t => {
15 const result = await execa('empty.js', {...fullStdio, all: true});16 t.deepEqual(Reflect.ownKeys(result), [17 'command',18 'escapedCommand',

Improve `cwd` option (#803)ehmickybefore adoption2fd9351

line 19why, one step back
19 'cwd',

Re-order return value properties (#801)ehmickybefore adoption72836f3

lines 20–37why, one step back
20 'failed',
21 'timedOut',22 'isCanceled',23 'isTerminated',24 'exitCode',25 'stdout',26 'stderr',27 'all',28 'stdio',29 ]);30});3132test('Error properties are not missing and are ordered', async t => {33 const error = await t.throwsAsync(execa('fail.js', {...fullStdio, all: true}));34 t.deepEqual(Reflect.ownKeys(error), [35 'stack',36 'message',37 'shortMessage',

Improve copying previous Execa errors (#806)ehmickybefore adoption121a052

line 38why, one step back
38 'originalMessage',

Re-order return value properties (#801)ehmickybefore adoption72836f3

lines 39–55why, one step back
39 'command',
40 'escapedCommand',41 'cwd',42 'failed',43 'timedOut',44 'isCanceled',45 'isTerminated',46 'exitCode',47 'signal',48 'signalDescription',49 'stdout',50 'stderr',51 'all',52 'stdio',53 ]);54});55

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

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

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

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

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

line 63why, one step back
63

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

line 66why, one step back
66

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

lines 67–72why, one step back
67const testUndefinedErrorStdio = async (t, execaMethod) => {
68 const {stdout, stderr, stdio} = await execaMethod('empty.js', {stdio: 'ignore'});69 t.is(stdout, undefined);70 t.is(stderr, undefined);71 t.deepEqual(stdio, [undefined, undefined, undefined]);72};

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

line 73why, one step back
73

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

lines 74–85why, one step back
74test('undefined error.stdout/stderr/stdio', testUndefinedErrorStdio, execa);
75test('undefined error.stdout/stderr/stdio - sync', testUndefinedErrorStdio, execaSync);7677const testEmptyAll = async (t, options, expectedValue) => {78 const {all} = await t.throwsAsync(execa('fail.js', options));79 t.is(all, expectedValue);80};8182test('empty error.all', testEmptyAll, {all: true}, '');83test('undefined error.all', testEmptyAll, {}, undefined);84test('ignored error.all', testEmptyAll, {all: true, stdio: 'ignore'}, undefined);85

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

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

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

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

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

lines 89–90why, one step back
89});
90

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

line 93why, one step back
93

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

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

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

line 95why, one step back
95 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 96–99why, one step back
96 t.true(SPAWN_ERROR_CODES.has(code));
97 t.is(stdout, undefined);98 t.is(stderr, undefined);99 t.deepEqual(stdio, [undefined, undefined, undefined]);

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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

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

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

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

line 105why, one step back
105 });

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

lines 106–109why, one step back
106 t.true(SPAWN_ERROR_CODES.has(code));
107 t.is(stdout, undefined);108 t.is(stderr, undefined);109 t.deepEqual(stdio, [undefined, undefined, undefined]);

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 110–111why, one step back
110});
111

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

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

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

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

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

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

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

line 119why, one step back
119

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

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

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

line 122why, one step back
122

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 125–127why, one step back
125 t.is(exitCode, 0);
126});127

Improve process failure logic (#807)ehmickybefore adoption8ff263c

lines 128–130why, one step back
128const testExitCode = async (t, expectedExitCode) => {
129 const {exitCode, originalMessage, shortMessage, message} = await t.throwsAsync(130 execa('exit.js', [`${expectedExitCode}`]),

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

line 131why, one step back
131 );

Improve process failure logic (#807)ehmickybefore adoption8ff263c

lines 132–135why, one step back
132 t.is(exitCode, expectedExitCode);
133 t.is(originalMessage, '');134 t.is(shortMessage, `Command failed with exit code ${expectedExitCode}: exit.js ${expectedExitCode}`);135 t.is(message, shortMessage);

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 136–142why, one step back
136};
137138test('exitCode is 2', testExitCode, 2);139test('exitCode is 3', testExitCode, 3);140test('exitCode is 4', testExitCode, 4);141142test('error.message contains the command', async t => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 144–145why, one step back
144});
145

Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce

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

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

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

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

lines 150–151why, one step back
150};
151

Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce

lines 152–159why, one step back
152test('error.message contains stdout/stderr/stdio if available', testStdioMessage, 'utf8', false, false);
153test('error.message contains stdout/stderr/stdio even with encoding "buffer"', testStdioMessage, 'buffer', false, false);154test('error.message contains all if available', testStdioMessage, 'utf8', true, false);155test('error.message contains all even with encoding "buffer"', testStdioMessage, 'buffer', true, false);156test('error.message contains stdout/stderr/stdio if available, objectMode', testStdioMessage, 'utf8', false, true);157test('error.message contains stdout/stderr/stdio even with encoding "buffer", objectMode', testStdioMessage, 'buffer', false, true);158test('error.message contains all if available, objectMode', testStdioMessage, 'utf8', true, true);159test('error.message contains all even with encoding "buffer", objectMode', testStdioMessage, 'buffer', true, true);

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

line 160why, one step back
160

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

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

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

line 165why, one step back
165

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

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

Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce

lines 168–169why, one step back
168test('error.message does not contain stdout if it is an object', testPartialIgnoreMessage, 1, outputObjectGenerator, 'stderr');
169test('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 170why, one step back
170

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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

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

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

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

line 176why, one step back
176};

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

line 177why, one step back
177

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

lines 178–187why, one step back
178test('error.message does not contain stdout/stderr/stdio if not available', testFullIgnoreMessage, {stdio: 'ignore'}, 'message');
179test('error.shortMessage does not contain stdout/stderr/stdio', testFullIgnoreMessage, fullStdio, 'shortMessage');180181const testErrorMessageConsistent = async (t, stdout) => {182 const {message} = await t.throwsAsync(execa('noop-both-fail.js', [stdout, 'stderr']));183 t.true(message.endsWith(`noop-both-fail.js ${stdout} stderr\n\nstderr\n\nstdout`));184};185186test('error.message newlines are consistent - no newline', testErrorMessageConsistent, 'stdout');187test('error.message newlines are consistent - newline', testErrorMessageConsistent, 'stdout\n');

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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

Improve `cwd` option (#803)ehmickybefore adoption2fd9351

lines 190–191why, one step back
190 const {originalMessage} = await t.throwsAsync(execa('noop.js', {uid: true}));
191 t.is(originalMessage, 'The "options.uid" property must be int32. Received type boolean (true)');

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 192–194why, one step back
192});
193194test('failed is false on success', async t => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 196–199why, one step back
196 t.false(failed);
197});198199test('failed is true on failure', async t => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 201–203why, one step back
201 t.true(failed);
202});203

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

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

Improve `killSignal` option (#728)ehmickybefore adoptioncf36c1d

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 206–208why, one step back
206
207 subprocess.kill();208

Improve process failure logic (#807)ehmickybefore adoption8ff263c

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

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

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

Improve `killSignal` option (#728)ehmickybefore adoptioncf36c1d

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

Improve process failure logic (#807)ehmickybefore adoption8ff263c

lines 212–214why, one step back
212 t.is(originalMessage, '');
213 t.is(shortMessage, 'Command was killed with SIGINT (User interruption with CTRL-C): forever.js');214 t.is(message, shortMessage);

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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

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

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

Improve `killSignal` option (#728)ehmickybefore adoptioncf36c1d

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 219–222why, one step back
219
220 process.kill(subprocess.pid, 'SIGINT');221222 // `process.kill()` is emulated by Node.js on Windows

Improve process termination (#724)ehmickybefore adoption1c48d37

lines 223–231why, one step back
223 if (isWindows) {
224 const {isTerminated, signal} = await t.throwsAsync(subprocess, {message: /failed with exit code 1/});225 t.is(isTerminated, false);226 t.is(signal, undefined);227 } else {228 const {isTerminated, signal} = await t.throwsAsync(subprocess, {message: /was killed with SIGINT/});229 t.is(isTerminated, true);230 t.is(signal, 'SIGINT');231 }

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 232–233why, one step back
232});
233

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 237–238why, one step back
237});
238

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

lines 239–244why, one step back
239test('result.isTerminated is false if not killed and childProcess.kill() was called', async t => {
240 const subprocess = execa('noop.js');241 subprocess.kill(0);242 t.true(subprocess.killed);243 const {isTerminated} = await subprocess;244 t.false(isTerminated);

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 245–246why, one step back
245});
246

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 250–251why, one step back
250});
251

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

lines 252–258why, one step back
252test('result.isTerminated is false on process error', async t => {
253 const {isTerminated} = await t.throwsAsync(execa('wrong command'));254 t.false(isTerminated);255});256257test('result.isTerminated is false on process error, in sync mode', t => {258 const {isTerminated} = t.throws(() => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

line 260why, one step back
260 });

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 262–263why, one step back
262});
263

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 267–274why, one step back
267
268 process.kill(subprocess.pid, 'SIGINT');269270 const {signal} = await t.throwsAsync(subprocess, {message: /was killed with SIGINT/});271 t.is(signal, 'SIGINT');272 });273274 test('error.signalDescription is defined', async t => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 276–283why, one step back
276
277 process.kill(subprocess.pid, 'SIGINT');278279 const {signalDescription} = await t.throwsAsync(subprocess, {message: /User interruption with CTRL-C/});280 t.is(signalDescription, 'User interruption with CTRL-C');281 });282283 test('error.signal is SIGTERM', async t => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 285–291why, one step back
285
286 process.kill(subprocess.pid, 'SIGTERM');287288 const {signal} = await t.throwsAsync(subprocess, {message: /was killed with SIGTERM/});289 t.is(signal, 'SIGTERM');290 });291

Improve `killSignal` option (#728)ehmickybefore adoptioncf36c1d

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

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

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 299–307why, one step back
299
300 process.kill(subprocess.pid);301302 const {exitCode} = await t.throwsAsync(subprocess);303 t.is(exitCode, undefined);304 });305}306307test('result.signal is undefined for successful execution', async t => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 309–312why, one step back
309 t.is(signal, undefined);
310});311312test('result.signal is undefined if process failed, but was not killed', async t => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 314–317why, one step back
314 t.is(signal, undefined);
315});316317test('result.signalDescription is undefined for successful execution', async t => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 319–322why, one step back
319 t.is(signalDescription, undefined);
320});321322test('error.code is undefined on success', async t => {

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

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

Revert "Add link to Netlify job description (#439)" (#445)ehmickybefore adoption2706b3f

lines 324–327why, one step back
324 t.is(code, undefined);
325});326327test('error.code is defined on failure if applicable', async t => {

Improve `cwd` option (#803)ehmickybefore adoption2fd9351

line 328why, one step back
328 const {code} = await t.throwsAsync(execa('noop.js', {uid: true}));

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

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

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

line 330why, one step back
330});