Skip to content
Myr

Fix fd-specific options (#974)

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

authored by ehmicky · committed by GitHub · parent a25a50d · Browse files · 3 files+58 added−2 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+58 added−2 removed

  • tests:+32 added−0 removed
  • other:+26 added−2 removed

3 files+58 added−2 removed

modified:lib/arguments/specific.js+13 added-2 removed
modified:test/stream/no-buffer.js+32 added
143 unmodified lines
144test('buffer: {stdout: false}, all: true, sync', testNoOutputAll, {stdout: false}, false, true, execaSync);145test('buffer: {stderr: false}, all: true, sync', testNoOutputAll, {stderr: false}, true, false, execaSync);146test('buffer: {all: false}, all: true, sync', testNoOutputAll, {all: false}, false, false, execaSync);147148// eslint-disable-next-line max-params149const testPriorityOrder = async (t, buffer, bufferStdout, bufferStderr, execaMethod) => {150 const {stdout, stderr} = await execaMethod('noop-both.js', {buffer});151 t.is(stdout, bufferStdout ? foobarString : undefined);152 t.is(stderr, bufferStderr ? foobarString : undefined);153};154155test('buffer: {stdout, fd1}', testPriorityOrder, {stdout: true, fd1: false}, true, true, execa);156test('buffer: {stdout, all}', testPriorityOrder, {stdout: true, all: false}, true, false, execa);157test('buffer: {fd1, all}', testPriorityOrder, {fd1: true, all: false}, true, false, execa);158test('buffer: {stderr, fd2}', testPriorityOrder, {stderr: true, fd2: false}, true, true, execa);159test('buffer: {stderr, all}', testPriorityOrder, {stderr: true, all: false}, false, true, execa);160test('buffer: {fd2, all}', testPriorityOrder, {fd2: true, all: false}, false, true, execa);161test('buffer: {fd1, stdout}', testPriorityOrder, {fd1: false, stdout: true}, true, true, execa);162test('buffer: {all, stdout}', testPriorityOrder, {all: false, stdout: true}, true, false, execa);163test('buffer: {all, fd1}', testPriorityOrder, {all: false, fd1: true}, true, false, execa);164test('buffer: {fd2, stderr}', testPriorityOrder, {fd2: false, stderr: true}, true, true, execa);165test('buffer: {all, stderr}', testPriorityOrder, {all: false, stderr: true}, false, true, execa);166test('buffer: {all, fd2}', testPriorityOrder, {all: false, fd2: true}, false, true, execa);167test('buffer: {stdout, fd1}, sync', testPriorityOrder, {stdout: true, fd1: false}, true, true, execaSync);168test('buffer: {stdout, all}, sync', testPriorityOrder, {stdout: true, all: false}, true, false, execaSync);169test('buffer: {fd1, all}, sync', testPriorityOrder, {fd1: true, all: false}, true, false, execaSync);170test('buffer: {stderr, fd2}, sync', testPriorityOrder, {stderr: true, fd2: false}, true, true, execaSync);171test('buffer: {stderr, all}, sync', testPriorityOrder, {stderr: true, all: false}, false, true, execaSync);172test('buffer: {fd2, all}, sync', testPriorityOrder, {fd2: true, all: false}, false, true, execaSync);173test('buffer: {fd1, stdout}, sync', testPriorityOrder, {fd1: false, stdout: true}, true, true, execaSync);174test('buffer: {all, stdout}, sync', testPriorityOrder, {all: false, stdout: true}, true, false, execaSync);175test('buffer: {all, fd1}, sync', testPriorityOrder, {all: false, fd1: true}, true, false, execaSync);176test('buffer: {fd2, stderr}, sync', testPriorityOrder, {fd2: false, stderr: true}, true, true, execaSync);177test('buffer: {all, stderr}, sync', testPriorityOrder, {all: false, stderr: true}, false, true, execaSync);178test('buffer: {all, fd2}, sync', testPriorityOrder, {all: false, fd2: true}, false, true, execaSync);179180const testTransform = async (t, objectMode, execaMethod) => {181 const lines = [];182 const {stdout} = await execaMethod('noop.js', {183 buffer: false,
41 unmodified lines
modified:index.test-d.ts+13 added
1633 unmodified lines
1634execaSync('unicorns', {buffer: {fd2: true}});1635execaSync('unicorns', {buffer: {fd3: true}});1636expectError(execaSync('unicorns', {buffer: {stdout: 'true'}}));16371638expectType<string[]>(execaSync('unicorns', {lines: {stdout: true, fd1: false}}).stdout);1639expectType<string[]>(execaSync('unicorns', {lines: {stdout: true, all: false}}).stdout);1640expectType<string[]>(execaSync('unicorns', {lines: {fd1: true, all: false}}).stdout);1641expectType<string[]>(execaSync('unicorns', {lines: {stderr: true, fd2: false}}).stderr);1642expectType<string[]>(execaSync('unicorns', {lines: {stderr: true, all: false}}).stderr);1643expectType<string[]>(execaSync('unicorns', {lines: {fd2: true, all: false}}).stderr);1644expectType<string[]>(execaSync('unicorns', {lines: {fd1: false, stdout: true}}).stdout);1645expectType<string[]>(execaSync('unicorns', {lines: {all: false, stdout: true}}).stdout);1646expectType<string[]>(execaSync('unicorns', {lines: {all: false, fd1: true}}).stdout);1647expectType<string[]>(execaSync('unicorns', {lines: {fd2: false, stderr: true}}).stderr);1648expectType<string[]>(execaSync('unicorns', {lines: {all: false, stderr: true}}).stderr);1649expectType<string[]>(execaSync('unicorns', {lines: {all: false, fd2: true}}).stderr);16501651const linesStdoutResult = await execa('unicorns', {all: true, lines: {stdout: true}});1652expectType<string[]>(linesStdoutResult.stdout);1653expectType<string[]>(linesStdoutResult.stdio[1]);1654expectType<string>(linesStdoutResult.stderr);
2479 unmodified lines