Skip to content
Myr

pipe-arguments.js

This file

Path

test/pipe/pipe-arguments.js

285 lines · 10.2 KiB · JavaScript

Last changed by

TweaksSindre Sorhusbefore adoption698a1b8

History of this file

Take it

The walk stopped after 200 commits: lines older than 9f65b86 point at it.

TweaksSindre Sorhusbefore adoption698a1b8

line 1why, one step back
1import assert from 'node:assert/strict';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 2–3why, one step back
2import {spawn} from 'node:child_process';
3import {pathToFileURL} from 'node:url';

TweaksSindre Sorhusbefore adoption698a1b8

lines 4–5why, one step back
4import test from 'node:test';
5import {assertRejects} from '../helpers/assert.js';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 6–8why, one step back
6import {$, execa} from '../../index.js';
7import {setFixtureDirectory, FIXTURES_DIRECTORY} from '../helpers/fixtures-directory.js';8import {foobarString} from '../helpers/input.js';

Fix deno node:process execPath compatibility (#1160)CJbefore adoptionf3a1bf3

line 9why, one step back
9import {getDenoNodePath} from '../helpers/file-path.js';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 10–12why, one step back
10
11setFixtureDirectory();12

TweaksSindre Sorhusbefore adoption698a1b8

line 13why, one step back
13test('$.pipe(subprocess)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 14why, one step back
14 const {stdout} = await $`noop.js ${foobarString}`.pipe($({stdin: 'pipe'})`stdin.js`);

TweaksSindre Sorhusbefore adoption698a1b8

line 15why, one step back
15 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 16–17why, one step back
16});
17

TweaksSindre Sorhusbefore adoption698a1b8

line 18why, one step back
18test('execa.$.pipe(subprocess)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 19why, one step back
19 const {stdout} = await execa('noop.js', [foobarString]).pipe($({stdin: 'pipe'})`stdin.js`);

TweaksSindre Sorhusbefore adoption698a1b8

line 20why, one step back
20 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 21–22why, one step back
21});
22

TweaksSindre Sorhusbefore adoption698a1b8

line 23why, one step back
23test('$.pipe.pipe(subprocess)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 24–26why, one step back
24 const {stdout} = await $`noop.js ${foobarString}`
25 .pipe($({stdin: 'pipe'})`stdin.js`)26 .pipe($({stdin: 'pipe'})`stdin.js`);

TweaksSindre Sorhusbefore adoption698a1b8

line 27why, one step back
27 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 28–29why, one step back
28});
29

TweaksSindre Sorhusbefore adoption698a1b8

line 30why, one step back
30test('$.pipe`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 31why, one step back
31 const {stdout} = await $`noop.js ${foobarString}`.pipe`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 32why, one step back
32 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 33–34why, one step back
33});
34

TweaksSindre Sorhusbefore adoption698a1b8

line 35why, one step back
35test('execa.$.pipe`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 36why, one step back
36 const {stdout} = await execa('noop.js', [foobarString]).pipe`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 37why, one step back
37 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 38–39why, one step back
38});
39

TweaksSindre Sorhusbefore adoption698a1b8

line 40why, one step back
40test('$.pipe.pipe`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 41–43why, one step back
41 const {stdout} = await $`noop.js ${foobarString}`
42 .pipe`stdin.js`43 .pipe`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 44why, one step back
44 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 45–46why, one step back
45});
46

TweaksSindre Sorhusbefore adoption698a1b8

line 47why, one step back
47test('$.pipe("file")', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 48why, one step back
48 const {stdout} = await $`noop.js ${foobarString}`.pipe('stdin.js');

TweaksSindre Sorhusbefore adoption698a1b8

line 49why, one step back
49 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 50–51why, one step back
50});
51

TweaksSindre Sorhusbefore adoption698a1b8

line 52why, one step back
52test('execa.$.pipe("file")`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 53why, one step back
53 const {stdout} = await execa('noop.js', [foobarString]).pipe('stdin.js');

TweaksSindre Sorhusbefore adoption698a1b8

line 54why, one step back
54 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 55–56why, one step back
55});
56

TweaksSindre Sorhusbefore adoption698a1b8

line 57why, one step back
57test('$.pipe.pipe("file")', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 58–60why, one step back
58 const {stdout} = await $`noop.js ${foobarString}`
59 .pipe`stdin.js`60 .pipe('stdin.js');

TweaksSindre Sorhusbefore adoption698a1b8

line 61why, one step back
61 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 62–63why, one step back
62});
63

TweaksSindre Sorhusbefore adoption698a1b8

line 64why, one step back
64test('execa.$.pipe(fileUrl)`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 65why, one step back
65 const {stdout} = await execa('noop.js', [foobarString]).pipe(pathToFileURL(`${FIXTURES_DIRECTORY}/stdin.js`));

TweaksSindre Sorhusbefore adoption698a1b8

line 66why, one step back
66 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 67–68why, one step back
67});
68

TweaksSindre Sorhusbefore adoption698a1b8

line 69why, one step back
69test('$.pipe("file", commandArguments, options)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 70why, one step back
70 const {stdout} = await $`noop.js ${foobarString}`.pipe('node', ['stdin.js'], {cwd: FIXTURES_DIRECTORY});

TweaksSindre Sorhusbefore adoption698a1b8

line 71why, one step back
71 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 72–73why, one step back
72});
73

TweaksSindre Sorhusbefore adoption698a1b8

line 74why, one step back
74test('execa.$.pipe("file", commandArguments, options)`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 75why, one step back
75 const {stdout} = await execa('noop.js', [foobarString]).pipe('node', ['stdin.js'], {cwd: FIXTURES_DIRECTORY});

TweaksSindre Sorhusbefore adoption698a1b8

line 76why, one step back
76 assert.equal(stdout, foobarString);

Fix deno node:process execPath compatibility (#1160)CJbefore adoptionf3a1bf3

lines 77–78why, one step back
77});
78

TweaksSindre Sorhusbefore adoption698a1b8

line 79why, one step back
79test('execa.$.pipe("file", commandArguments, options with denoNodePath)`', async () => {

Fix deno node:process execPath compatibility (#1160)CJbefore adoptionf3a1bf3

line 80why, one step back
80 const {stdout} = await execa('noop.js', [foobarString]).pipe('node', ['stdin.js'], {cwd: FIXTURES_DIRECTORY, nodePath: getDenoNodePath()});

TweaksSindre Sorhusbefore adoption698a1b8

line 81why, one step back
81 assert.equal(stdout, foobarString);

Fix deno node:process execPath compatibility (#1160)CJbefore adoptionf3a1bf3

lines 82–83why, one step back
82});
83

TweaksSindre Sorhusbefore adoption698a1b8

line 84why, one step back
84test('execa.$.pipe("file", commandArguments, denoNodePath)`', async () => {

Fix deno node:process execPath compatibility (#1160)CJbefore adoptionf3a1bf3

line 85why, one step back
85 const {stdout} = await execa('noop.js', [foobarString]).pipe(getDenoNodePath(), ['stdin.js'], {cwd: FIXTURES_DIRECTORY});

TweaksSindre Sorhusbefore adoption698a1b8

line 86why, one step back
86 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 87–88why, one step back
87});
88

TweaksSindre Sorhusbefore adoption698a1b8

line 89why, one step back
89test('$.pipe.pipe("file", commandArguments, options)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 90–92why, one step back
90 const {stdout} = await $`noop.js ${foobarString}`
91 .pipe`stdin.js`92 .pipe('node', ['stdin.js'], {cwd: FIXTURES_DIRECTORY});

TweaksSindre Sorhusbefore adoption698a1b8

line 93why, one step back
93 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 94–95why, one step back
94});
95

TweaksSindre Sorhusbefore adoption698a1b8

line 96why, one step back
96test('$.pipe(subprocess, pipeOptions)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 97why, one step back
97 const {stdout} = await $`noop-fd.js 2 ${foobarString}`.pipe($({stdin: 'pipe'})`stdin.js`, {from: 'stderr'});

TweaksSindre Sorhusbefore adoption698a1b8

line 98why, one step back
98 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

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

TweaksSindre Sorhusbefore adoption698a1b8

line 101why, one step back
101test('execa.$.pipe(subprocess, pipeOptions)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 102why, one step back
102 const {stdout} = await execa('noop-fd.js', ['2', foobarString]).pipe($({stdin: 'pipe'})`stdin.js`, {from: 'stderr'});

TweaksSindre Sorhusbefore adoption698a1b8

line 103why, one step back
103 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 104–105why, one step back
104});
105

TweaksSindre Sorhusbefore adoption698a1b8

line 106why, one step back
106test('$.pipe.pipe(subprocess, pipeOptions)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 107–109why, one step back
107 const {stdout} = await $`noop-fd.js 2 ${foobarString}`
108 .pipe($({stdin: 'pipe'})`noop-stdin-fd.js 2`, {from: 'stderr'})109 .pipe($({stdin: 'pipe'})`stdin.js`, {from: 'stderr'});

TweaksSindre Sorhusbefore adoption698a1b8

line 110why, one step back
110 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

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

TweaksSindre Sorhusbefore adoption698a1b8

line 113why, one step back
113test('$.pipe(pipeOptions)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 114why, one step back
114 const {stdout} = await $`noop-fd.js 2 ${foobarString}`.pipe({from: 'stderr'})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 115why, one step back
115 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 116–117why, one step back
116});
117

TweaksSindre Sorhusbefore adoption698a1b8

line 118why, one step back
118test('execa.$.pipe(pipeOptions)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 119why, one step back
119 const {stdout} = await execa('noop-fd.js', ['2', foobarString]).pipe({from: 'stderr'})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 120why, one step back
120 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 121–122why, one step back
121});
122

TweaksSindre Sorhusbefore adoption698a1b8

line 123why, one step back
123test('$.pipe.pipe(pipeOptions)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 124–126why, one step back
124 const {stdout} = await $`noop-fd.js 2 ${foobarString}`
125 .pipe({from: 'stderr'})`noop-stdin-fd.js 2`126 .pipe({from: 'stderr'})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 127why, one step back
127 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 128–129why, one step back
128});
129

TweaksSindre Sorhusbefore adoption698a1b8

line 130why, one step back
130test('$.pipe("file", pipeOptions)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 131why, one step back
131 const {stdout} = await $`noop-fd.js 2 ${foobarString}`.pipe('stdin.js', {from: 'stderr'});

TweaksSindre Sorhusbefore adoption698a1b8

line 132why, one step back
132 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 133–134why, one step back
133});
134

TweaksSindre Sorhusbefore adoption698a1b8

line 135why, one step back
135test('execa.$.pipe("file", pipeOptions)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 136why, one step back
136 const {stdout} = await execa('noop-fd.js', ['2', foobarString]).pipe('stdin.js', {from: 'stderr'});

TweaksSindre Sorhusbefore adoption698a1b8

line 137why, one step back
137 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 138–139why, one step back
138});
139

TweaksSindre Sorhusbefore adoption698a1b8

line 140why, one step back
140test('$.pipe.pipe("file", pipeOptions)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 141–143why, one step back
141 const {stdout} = await $`noop-fd.js 2 ${foobarString}`
142 .pipe({from: 'stderr'})`noop-stdin-fd.js 2`143 .pipe('stdin.js', {from: 'stderr'});

TweaksSindre Sorhusbefore adoption698a1b8

line 144why, one step back
144 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

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

TweaksSindre Sorhusbefore adoption698a1b8

line 147why, one step back
147test('$.pipe(options)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 148why, one step back
148 const {stdout} = await $`noop.js ${foobarString}`.pipe({stripFinalNewline: false})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 149why, one step back
149 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

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

TweaksSindre Sorhusbefore adoption698a1b8

line 152why, one step back
152test('execa.$.pipe(options)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 153why, one step back
153 const {stdout} = await execa('noop.js', [foobarString]).pipe({stripFinalNewline: false})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 154why, one step back
154 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 155–156why, one step back
155});
156

TweaksSindre Sorhusbefore adoption698a1b8

line 157why, one step back
157test('$.pipe.pipe(options)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 158–160why, one step back
158 const {stdout} = await $`noop.js ${foobarString}`
159 .pipe({})`stdin.js`160 .pipe({stripFinalNewline: false})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 161why, one step back
161 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 162–163why, one step back
162});
163

TweaksSindre Sorhusbefore adoption698a1b8

line 164why, one step back
164test('$.pipe("file", options)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 165why, one step back
165 const {stdout} = await $`noop.js ${foobarString}`.pipe('stdin.js', {stripFinalNewline: false});

TweaksSindre Sorhusbefore adoption698a1b8

line 166why, one step back
166 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 167–168why, one step back
167});
168

TweaksSindre Sorhusbefore adoption698a1b8

line 169why, one step back
169test('execa.$.pipe("file", options)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 170why, one step back
170 const {stdout} = await execa('noop.js', [foobarString]).pipe('stdin.js', {stripFinalNewline: false});

TweaksSindre Sorhusbefore adoption698a1b8

line 171why, one step back
171 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 172–173why, one step back
172});
173

TweaksSindre Sorhusbefore adoption698a1b8

line 174why, one step back
174test('$.pipe.pipe("file", options)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 175–177why, one step back
175 const {stdout} = await $`noop.js ${foobarString}`
176 .pipe({})`stdin.js`177 .pipe('stdin.js', {stripFinalNewline: false});

TweaksSindre Sorhusbefore adoption698a1b8

line 178why, one step back
178 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 179–180why, one step back
179});
180

TweaksSindre Sorhusbefore adoption698a1b8

line 181why, one step back
181test('$.pipe(pipeAndSubprocessOptions)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 182why, one step back
182 const {stdout} = await $`noop-fd.js 2 ${foobarString}\n`.pipe({from: 'stderr', stripFinalNewline: false})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 183why, one step back
183 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 184–185why, one step back
184});
185

TweaksSindre Sorhusbefore adoption698a1b8

line 186why, one step back
186test('execa.$.pipe(pipeAndSubprocessOptions)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 187why, one step back
187 const {stdout} = await execa('noop-fd.js', ['2', `${foobarString}\n`]).pipe({from: 'stderr', stripFinalNewline: false})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 188why, one step back
188 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 189–190why, one step back
189});
190

TweaksSindre Sorhusbefore adoption698a1b8

line 191why, one step back
191test('$.pipe.pipe(pipeAndSubprocessOptions)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 192–194why, one step back
192 const {stdout} = await $`noop-fd.js 2 ${foobarString}\n`
193 .pipe({from: 'stderr'})`noop-stdin-fd.js 2`194 .pipe({from: 'stderr', stripFinalNewline: false})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 195why, one step back
195 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 196–197why, one step back
196});
197

TweaksSindre Sorhusbefore adoption698a1b8

line 198why, one step back
198test('$.pipe("file", pipeAndSubprocessOptions)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 199why, one step back
199 const {stdout} = await $`noop-fd.js 2 ${foobarString}\n`.pipe('stdin.js', {from: 'stderr', stripFinalNewline: false});

TweaksSindre Sorhusbefore adoption698a1b8

line 200why, one step back
200 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 201–202why, one step back
201});
202

TweaksSindre Sorhusbefore adoption698a1b8

line 203why, one step back
203test('execa.$.pipe("file", pipeAndSubprocessOptions)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 204why, one step back
204 const {stdout} = await execa('noop-fd.js', ['2', `${foobarString}\n`]).pipe('stdin.js', {from: 'stderr', stripFinalNewline: false});

TweaksSindre Sorhusbefore adoption698a1b8

line 205why, one step back
205 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 206–207why, one step back
206});
207

TweaksSindre Sorhusbefore adoption698a1b8

line 208why, one step back
208test('$.pipe.pipe("file", pipeAndSubprocessOptions)', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 209–211why, one step back
209 const {stdout} = await $`noop-fd.js 2 ${foobarString}\n`
210 .pipe({from: 'stderr'})`noop-stdin-fd.js 2`211 .pipe('stdin.js', {from: 'stderr', stripFinalNewline: false});

TweaksSindre Sorhusbefore adoption698a1b8

line 212why, one step back
212 assert.equal(stdout, `${foobarString}\n`);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 213–214why, one step back
213});
214

TweaksSindre Sorhusbefore adoption698a1b8

line 215why, one step back
215test('$.pipe(options)(secondOptions)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 216why, one step back
216 const {stdout} = await $`noop.js ${foobarString}`.pipe({stripFinalNewline: false})({stripFinalNewline: true})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 217why, one step back
217 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 218–219why, one step back
218});
219

TweaksSindre Sorhusbefore adoption698a1b8

line 220why, one step back
220test('execa.$.pipe(options)(secondOptions)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 221why, one step back
221 const {stdout} = await execa('noop.js', [foobarString]).pipe({stripFinalNewline: false})({stripFinalNewline: true})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 222why, one step back
222 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 223–224why, one step back
223});
224

TweaksSindre Sorhusbefore adoption698a1b8

line 225why, one step back
225test('$.pipe.pipe(options)(secondOptions)`command`', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 226–228why, one step back
226 const {stdout} = await $`noop.js ${foobarString}`
227 .pipe({})({})`stdin.js`228 .pipe({stripFinalNewline: false})({stripFinalNewline: true})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 229why, one step back
229 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 230–231why, one step back
230});
231

TweaksSindre Sorhusbefore adoption698a1b8

line 232why, one step back
232test('$.pipe`command` forces "stdin: pipe"', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 233why, one step back
233 const {stdout} = await $`noop.js ${foobarString}`.pipe({stdin: 'ignore'})`stdin.js`;

TweaksSindre Sorhusbefore adoption698a1b8

line 234why, one step back
234 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 235–236why, one step back
235});
236

TweaksSindre Sorhusbefore adoption698a1b8

line 237why, one step back
237test('execa.pipe("file") forces "stdin: "pipe"', async () => {

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 238why, one step back
238 const {stdout} = await execa('noop.js', [foobarString]).pipe('stdin.js', {stdin: 'ignore'});

TweaksSindre Sorhusbefore adoption698a1b8

line 239why, one step back
239 assert.equal(stdout, foobarString);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 240–241why, one step back
240});
241

TweaksSindre Sorhusbefore adoption698a1b8

lines 242–243why, one step back
242test('execa.pipe(subprocess) does not force "stdin: pipe"', async () => {
243 await assertRejects(

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 244–248why, one step back
244 execa('noop.js', [foobarString]).pipe(execa('stdin.js', {stdin: 'ignore'})),
245 {message: /"stdin: 'ignore'" option is incompatible/},246 );247});248

TweaksSindre Sorhusbefore adoption698a1b8

lines 249–250why, one step back
249test('$.pipe(options)(subprocess) fails', async () => {
250 await assertRejects(

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 251–255why, one step back
251 $`empty.js`.pipe({stdout: 'pipe'})($`empty.js`),
252 {message: /Please use \.pipe/},253 );254});255

TweaksSindre Sorhusbefore adoption698a1b8

lines 256–257why, one step back
256test('execa.$.pipe(options)(subprocess) fails', async () => {
257 await assertRejects(

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 258–262why, one step back
258 execa('empty.js').pipe({stdout: 'pipe'})($`empty.js`),
259 {message: /Please use \.pipe/},260 );261});262

TweaksSindre Sorhusbefore adoption698a1b8

lines 263–264why, one step back
263test('$.pipe(options)("file") fails', async () => {
264 await assertRejects(

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 265–269why, one step back
265 $`empty.js`.pipe({stdout: 'pipe'})('empty.js'),
266 {message: /Please use \.pipe/},267 );268});269

TweaksSindre Sorhusbefore adoption698a1b8

lines 270–271why, one step back
270test('execa.$.pipe(options)("file") fails', async () => {
271 await assertRejects(

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 272–276why, one step back
272 execa('empty.js').pipe({stdout: 'pipe'})('empty.js'),
273 {message: /Please use \.pipe/},274 );275});276

TweaksSindre Sorhusbefore adoption698a1b8

lines 277–278why, one step back
277const testInvalidPipe = async (...pipeArguments) => {
278 await assertRejects(

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 279–283why, one step back
279 $`empty.js`.pipe(...pipeArguments),
280 {message: /must be a template string/},281 );282};283

TweaksSindre Sorhusbefore adoption698a1b8

lines 284–285why, one step back
284test('$.pipe(nonExecaSubprocess) fails', () => testInvalidPipe(spawn('node', ['--version'])));
285test('$.pipe(false) fails', () => testInvalidPipe(false));