Skip to content

Commit 34d26eb

Browse files
committed
ensure basic control of stdout and stderr
1 parent 7fa4c23 commit 34d26eb

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/__snapshots__/basic.ts.snap

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`basic should keep its stdout and stderr stable 1`] = `
4+
"@x/p1
5+
| $ sleep $1; echo @x/p1 $1 >> '/home/spion/Projects/wsrun/tmp/wsrun-packages/p1/test-1/echo.out' 0 Hello
6+
@x/p2
7+
| $ sleep $1; echo @x/p2 $1 >> '/home/spion/Projects/wsrun/tmp/wsrun-packages/p2/test-1/echo.out' 0 Hello
8+
"
9+
`;
10+
11+
exports[`basic should keep its stdout and stderr stable 2`] = `
12+
" | sleep: missing operand
13+
| Try 'sleep --help' for more information.
14+
| sleep: missing operand
15+
| Try 'sleep --help' for more information.
16+
"
17+
`;

tests/basic.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,20 @@ describe('basic', () => {
217217
}
218218
)
219219
})
220+
221+
it('should keep its stdout and stderr stable', async () => {
222+
await withScaffold(
223+
{
224+
packages: [
225+
echo.makePkg({ name: '@x/p1', path: 'packages/p1', dependencies: {} }),
226+
echo.makePkg({ name: '@x/p2', path: 'packages/p2', dependencies: { '@x/p1': '*' } })
227+
]
228+
},
229+
async () => {
230+
let tst = await wsrun('--serial doecho 0 Hello')
231+
expect(tst.stdout.toString()).toMatchSnapshot()
232+
expect(tst.stderr.toString()).toMatchSnapshot()
233+
}
234+
)
235+
})
220236
})

0 commit comments

Comments
 (0)