stdio.js
This file
Path
test/stdio.js
66 lines · 3.5 KiB · JavaScript
Last changed by
Rename variables in `stdio` file (#306)ehmickybefore adoptiona9fa13f
History of this fileTake it
The walk stopped after 200 commits: lines older than 0e780f8 point at it.
Tiny travis.yml tweakSindre Sorhusbefore adoption0e780f8
lines 1–2why, one step back1import util from 'util';2import test from 'ava';Rename variables in `stdio` file (#306)ehmickybefore adoptiona9fa13f
line 3why, one step back3import normalizeStdio from '../lib/stdio';Tiny travis.yml tweakSindre Sorhusbefore adoption0e780f8
line 4why, one step back4Simplify tests for stdio (#300)ehmickybefore adoptionab83d8d
lines 5–7why, one step back5const macro = (t, input, expected, func) => {6 if (expected instanceof Error) {7 t.throws(() => {Rename variables in `stdio` file (#306)ehmickybefore adoptiona9fa13f
line 8why, one step back8 normalizeStdio(input);Simplify tests for stdio (#300)ehmickybefore adoptionab83d8d
lines 9–11why, one step back9 }, expected.message);10 return;11 }Tiny travis.yml tweakSindre Sorhusbefore adoption0e780f8
line 12why, one step back12Simplify tests for stdio (#300)ehmickybefore adoptionab83d8d
lines 13–14why, one step back13 t.deepEqual(func(input), expected);14};Tiny travis.yml tweakSindre Sorhusbefore adoption0e780f8
line 15why, one step back15Simplify tests for stdio (#300)ehmickybefore adoptionab83d8d
line 16why, one step back16const macroTitle = name => (title, input) => `${name} ${(util.inspect(input))}`;Tiny travis.yml tweakSindre Sorhusbefore adoption0e780f8
line 17why, one step back17Rename variables in `stdio` file (#306)ehmickybefore adoptiona9fa13f
line 18why, one step back18const stdioMacro = (...args) => macro(...args, normalizeStdio);Simplify tests for stdio (#300)ehmickybefore adoptionab83d8d
line 19why, one step back19stdioMacro.title = macroTitle('execa()');Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
lines 20–22why, one step back2021test(stdioMacro, undefined, undefined);22test(stdioMacro, null, undefined);Tiny travis.yml tweakSindre Sorhusbefore adoption0e780f8
line 23why, one step back23Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
lines 24–27why, one step back24test(stdioMacro, {stdio: 'inherit'}, 'inherit');25test(stdioMacro, {stdio: 'pipe'}, 'pipe');26test(stdioMacro, {stdio: 'ignore'}, 'ignore');27test(stdioMacro, {stdio: [0, 1, 2]}, [0, 1, 2]);Tiny travis.yml tweakSindre Sorhusbefore adoption0e780f8
line 28why, one step back28Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
lines 29–41why, one step back29test(stdioMacro, {}, [undefined, undefined, undefined]);30test(stdioMacro, {stdio: []}, [undefined, undefined, undefined]);31test(stdioMacro, {stdin: 'pipe'}, ['pipe', undefined, undefined]);32test(stdioMacro, {stdout: 'ignore'}, [undefined, 'ignore', undefined]);33test(stdioMacro, {stderr: 'inherit'}, [undefined, undefined, 'inherit']);34test(stdioMacro, {stdin: 'pipe', stdout: 'ignore', stderr: 'inherit'}, ['pipe', 'ignore', 'inherit']);35test(stdioMacro, {stdin: 'pipe', stdout: 'ignore'}, ['pipe', 'ignore', undefined]);36test(stdioMacro, {stdin: 'pipe', stderr: 'inherit'}, ['pipe', undefined, 'inherit']);37test(stdioMacro, {stdout: 'ignore', stderr: 'inherit'}, [undefined, 'ignore', 'inherit']);38test(stdioMacro, {stdin: 0, stdout: 1, stderr: 2}, [0, 1, 2]);39test(stdioMacro, {stdin: 0, stdout: 1}, [0, 1, undefined]);40test(stdioMacro, {stdin: 0, stderr: 2}, [0, undefined, 2]);41test(stdioMacro, {stdout: 1, stderr: 2}, [undefined, 1, 2]);Tiny travis.yml tweakSindre Sorhusbefore adoption0e780f8
line 42why, one step back42Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
line 43why, one step back43test(stdioMacro, {stdio: {foo: 'bar'}}, new TypeError('Expected `stdio` to be of type `string` or `Array`, got `object`'));Tiny travis.yml tweakSindre Sorhusbefore adoption0e780f8
line 44why, one step back44Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
lines 45–47why, one step back45test(stdioMacro, {stdin: 'inherit', stdio: 'pipe'}, new Error('It\'s not possible to provide `stdio` in combination with one of `stdin`, `stdout`, `stderr`'));46test(stdioMacro, {stdin: 'inherit', stdio: ['pipe']}, new Error('It\'s not possible to provide `stdio` in combination with one of `stdin`, `stdout`, `stderr`'));47test(stdioMacro, {stdin: 'inherit', stdio: [undefined, 'pipe']}, new Error('It\'s not possible to provide `stdio` in combination with one of `stdin`, `stdout`, `stderr`'));Do not allow `stdin: 0` combined with `stdio` (#301)ehmickybefore adoption2c65870
line 48why, one step back48test(stdioMacro, {stdin: 0, stdio: 'pipe'}, new Error('It\'s not possible to provide `stdio` in combination with one of `stdin`, `stdout`, `stderr`'));Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
line 49why, one step back49Rename variables in `stdio` file (#306)ehmickybefore adoptiona9fa13f
line 50why, one step back50const forkMacro = (...args) => macro(...args, normalizeStdio.node);Simplify tests for stdio (#300)ehmickybefore adoptionab83d8d
line 51why, one step back51forkMacro.title = macroTitle('execa.fork()');Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
line 52why, one step back52Refactor `stdio` option for `execa.node()` (#303)ehmickybefore adoption825f8a7
line 53why, one step back53test(forkMacro, undefined, [undefined, undefined, undefined, 'ipc']);Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
line 54why, one step back54test(forkMacro, {stdio: 'ignore'}, ['ignore', 'ignore', 'ignore', 'ipc']);Refactor `stdio` option for `execa.node()` (#303)ehmickybefore adoption825f8a7
line 55why, one step back55test(forkMacro, {stdio: 'ipc'}, 'ipc');Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
lines 56–59why, one step back56test(forkMacro, {stdio: [0, 1, 2]}, [0, 1, 2, 'ipc']);57test(forkMacro, {stdio: [0, 1, 2, 3]}, [0, 1, 2, 3, 'ipc']);58test(forkMacro, {stdio: [0, 1, 2, 'ipc']}, [0, 1, 2, 'ipc']);59Refactor `stdio` option for `execa.node()` (#303)ehmickybefore adoption825f8a7
lines 60–63why, one step back60test(forkMacro, {stdio: [0, 1, undefined]}, [0, 1, undefined, 'ipc']);61test(forkMacro, {stdio: [0, 1, 2, undefined]}, [0, 1, 2, undefined, 'ipc']);62test(forkMacro, {stdout: 'ignore'}, [undefined, 'ignore', undefined, 'ipc']);63test(forkMacro, {stdout: 'ignore', stderr: 'ignore'}, [undefined, 'ignore', 'ignore', 'ipc']);Add `.node()` method (#200)Guillaume Martignybefore adoptionc2f5edf
lines 64–66why, one step back6465test(forkMacro, {stdio: {foo: 'bar'}}, new TypeError('Expected `stdio` to be of type `string` or `Array`, got `object`'));66test(forkMacro, {stdin: 'inherit', stdio: 'pipe'}, new Error('It\'s not possible to provide `stdio` in combination with one of `stdin`, `stdout`, `stderr`'));