Skip to content

Commit

Permalink
test: mixed stdio opts handling
Browse files Browse the repository at this point in the history
relates google#945
  • Loading branch information
antongolub committed Nov 15, 2024
1 parent 63403c3 commit dea1ccd
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`
).toString(),
''
)
assert.equal(
(
await $({ halt: true })`>&2 echo error`
.stdio('inherit', 'pipe', 'ignore')
.quiet()
.run()
).toString(),
''
)
})

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

0 comments on commit dea1ccd

Please sign in to comment.