mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-05 12:17:27 +00:00
test(app): add a golden path for mocked e2e prompts (#20593)
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user