mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 05:31:30 +00:00
test: stabilize json runtime captures (#52428) (thanks @karanuppal)
This commit is contained in:
@@ -15,6 +15,7 @@ vi.mock("../runtime.js", () => ({
|
||||
defaultRuntime: {
|
||||
log: (...args: unknown[]) => mockLog(...args),
|
||||
error: (...args: unknown[]) => mockError(...args),
|
||||
writeStdout: (value: string) => mockLog(value.endsWith("\n") ? value.slice(0, -1) : value),
|
||||
writeJson: (value: unknown, space = 2) =>
|
||||
mockLog(JSON.stringify(value, null, space > 0 ? space : undefined)),
|
||||
exit: (code: number) => mockExit(code),
|
||||
|
||||
Reference in New Issue
Block a user