Skip to content
Myr

Fix `all` option combined with `ignore` (#703)

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

authored by ehmicky · committed by GitHub · parent b8c1f55 · Browse files · 3 files+30 added−18 removed
This commit

State

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

Diff stats

3 files+30 added−18 removed

  • tests:+27 added−3 removed
  • other:+3 added−15 removed

3 files+30 added−18 removed

modified:lib/stream.js+3 added-15 removed
added:test/fixtures/noop-both.js+6 added
modified:test/stream.js+21 added-3 removed
24 unmodified lines
25 t.is(all, undefined);26});2728const testAllIgnore = async (t, streamName, otherStreamName) => {29 const childProcess = execa('noop.js', {[otherStreamName]: 'ignore', all: true});30 t.is(childProcess.all, childProcess[streamName]);31 await childProcess;29 const childProcess = execa('noop-both.js', {[otherStreamName]: 'ignore', all: true});30 t.is(childProcess[otherStreamName], null);31 t.not(childProcess[streamName], null);32 t.not(childProcess.all, null);3334 const result = await childProcess;35 t.is(result[otherStreamName], undefined);36 t.is(result[streamName], 'foobar');37 t.is(result.all, 'foobar');38};3940test('can use all: true with stdout: ignore', testAllIgnore, 'stderr', 'stdout');41test('can use all: true with stderr: ignore', testAllIgnore, 'stdout', 'stderr');4243test('can use all: true with stdout: ignore + stderr: ignore', async t => {44 const childProcess = execa('noop-both.js', {stdout: 'ignore', stderr: 'ignore', all: true});45 t.is(childProcess.stdout, null);46 t.is(childProcess.stderr, null);47 t.is(childProcess.all, undefined);4849 const {stdout, stderr, all} = await childProcess;50 t.is(stdout, undefined);51 t.is(stderr, undefined);52 t.is(all, undefined);53});5455const testIgnore = async (t, index, execaMethod) => {56 const result = await execaMethod('noop.js', getStdio(index, 'ignore'));57 t.is(result.stdio[index], undefined);58};
264 unmodified lines