Skip to content

Commit

Permalink
test: mixed stdio opts handling (#946)
Browse files Browse the repository at this point in the history
relates #945
  • Loading branch information
antongolub authored Nov 15, 2024
1 parent 63403c3 commit e666e11
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,27 @@ describe('core', () => {
assert.equal(r1, r2)
})

test('mixed', async () => {
assert.equal(
(
await $({
quiet: true,
stdio: ['inherit', 'pipe', 'ignore'],
})`>&2 echo error; echo ok`
).toString(),
'ok\n'
)
assert.equal(
(
await $({ halt: true })`>&2 echo error; echo ok`
.stdio('inherit', 'ignore', 'pipe')
.quiet()
.run()
).toString(),
'error\n'
)
})

test('file stream as stdout', async () => {
const createWriteStream = (f) => {
const stream = fs.createWriteStream(f)
Expand Down

0 comments on commit e666e11

Please sign in to comment.