mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-13 15:41:50 +00:00
test(app): add a golden path for mocked e2e prompts (#20593)
This commit is contained in:
parent
363891126c
commit
c3ef69c866
35 changed files with 2400 additions and 2071 deletions
|
|
@ -159,7 +159,17 @@ describe("cross-spawn spawner", () => {
|
|||
fx.effect(
|
||||
"captures both stdout and stderr",
|
||||
Effect.gen(function* () {
|
||||
const handle = yield* js('process.stdout.write("stdout\\n"); process.stderr.write("stderr\\n")')
|
||||
const handle = yield* js(
|
||||
[
|
||||
"let pending = 2",
|
||||
"const done = () => {",
|
||||
" pending -= 1",
|
||||
" if (pending === 0) setTimeout(() => process.exit(0), 0)",
|
||||
"}",
|
||||
'process.stdout.write("stdout\\n", done)',
|
||||
'process.stderr.write("stderr\\n", done)',
|
||||
].join("\n"),
|
||||
)
|
||||
const [stdout, stderr] = yield* Effect.all([decodeByteStream(handle.stdout), decodeByteStream(handle.stderr)])
|
||||
expect(stdout).toBe("stdout")
|
||||
expect(stderr).toBe("stderr")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue