Skip to content
Myr

Do not allow `overlapped` with `execaSync()` (#949)

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

authored by ehmicky · committed by GitHub · parent 96d2ef7 · Browse files · 2 files+14 added−9 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+14 added−9 removed

  • tests:+13 added−8 removed
  • other:+1 added−1 removed

2 files+14 added−9 removed

modified:lib/stdio/sync.js+1 added-1 removed
modified:test/stdio/handle.js+13 added-8 removed
61 unmodified lines
62test('stdio[*] can be ["inherit"]', testNoPipeOption, ['inherit'], 3);63test('stdio[*] can be 3', testNoPipeOption, 3, 3);64test('stdio[*] can be [3]', testNoPipeOption, [3], 3);6566const testNoIpcSync = (t, fdNumber) => {67 t.throws(() => {68 execaSync('empty.js', getStdio(fdNumber, 'ipc'));69 }, {message: /cannot be "ipc" with synchronous methods/});66const testInvalidValueSync = (t, fdNumber, stdioOption) => {67 const {message} = t.throws(() => {68 execaSync('empty.js', getStdio(fdNumber, stdioOption));69 });70 t.true(message.includes(`cannot be "${stdioOption}" with synchronous methods`));71};7272test('stdin cannot be "ipc", sync', testNoIpcSync, 0);73test('stdout cannot be "ipc", sync', testNoIpcSync, 1);74test('stderr cannot be "ipc", sync', testNoIpcSync, 2);75test('stdio[*] cannot be "ipc", sync', testNoIpcSync, 3);73test('stdin cannot be "ipc", sync', testInvalidValueSync, 0, 'ipc');74test('stdout cannot be "ipc", sync', testInvalidValueSync, 1, 'ipc');75test('stderr cannot be "ipc", sync', testInvalidValueSync, 2, 'ipc');76test('stdio[*] cannot be "ipc", sync', testInvalidValueSync, 3, 'ipc');77test('stdin cannot be "overlapped", sync', testInvalidValueSync, 0, 'overlapped');78test('stdout cannot be "overlapped", sync', testInvalidValueSync, 1, 'overlapped');79test('stderr cannot be "overlapped", sync', testInvalidValueSync, 2, 'overlapped');80test('stdio[*] cannot be "overlapped", sync', testInvalidValueSync, 3, 'overlapped');8182const testInvalidArrayValue = (t, invalidStdio, fdNumber, execaMethod) => {83 t.throws(() => {84 execaMethod('empty.js', getStdio(fdNumber, ['pipe', invalidStdio]));
19 unmodified lines