diff --git a/packages/opencode/test/lib/cli-process.ts b/packages/opencode/test/lib/cli-process.ts
index 9c34e336b..6b16ab74b 100644
--- a/packages/opencode/test/lib/cli-process.ts
+++ b/packages/opencode/test/lib/cli-process.ts
@@ -237,8 +237,8 @@ export function withCliFixture(
)
return {
exitCode: result.exitCode,
- stdout: result.stdout.toString(),
- stderr: result.stderr.toString(),
+ stdout: normalizeLines(result.stdout.toString()),
+ stderr: normalizeLines(result.stderr.toString()),
durationMs: Date.now() - start,
}
})
@@ -299,8 +299,8 @@ export function withCliFixture(
interrupt: () => proc.kill("SIGINT"),
result: Effect.promise(async () => ({
exitCode: await proc.exited,
- stdout: await stdout,
- stderr: await stderr,
+ stdout: normalizeLines(await stdout),
+ stderr: normalizeLines(await stderr),
durationMs: Date.now() - start,
})),
} satisfies RunHandle
@@ -479,6 +479,10 @@ function parseJsonEvents(stdout: string): Array> {
.map((line) => JSON.parse(line) as Record)
}
+function normalizeLines(value: string) {
+ return value.replaceAll("\r\n", "\n")
+}
+
// Convenience for the common assertion pattern. Dumps stderr/stdout when
// the exit code doesn't match — saves debugging time on CI failures.
function expectExit(result: RunResult, expected: number, label = "opencode") {