Skip to content

Commit e666e11

Browse files
authored
test: mixed stdio opts handling (google#946)
relates google#945
1 parent 63403c3 commit e666e11

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/core.test.js

+21
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,27 @@ describe('core', () => {
279279
assert.equal(r1, r2)
280280
})
281281

282+
test('mixed', async () => {
283+
assert.equal(
284+
(
285+
await $({
286+
quiet: true,
287+
stdio: ['inherit', 'pipe', 'ignore'],
288+
})`>&2 echo error; echo ok`
289+
).toString(),
290+
'ok\n'
291+
)
292+
assert.equal(
293+
(
294+
await $({ halt: true })`>&2 echo error; echo ok`
295+
.stdio('inherit', 'ignore', 'pipe')
296+
.quiet()
297+
.run()
298+
).toString(),
299+
'error\n'
300+
)
301+
})
302+
282303
test('file stream as stdout', async () => {
283304
const createWriteStream = (f) => {
284305
const stream = fs.createWriteStream(f)

0 commit comments

Comments
 (0)