mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-25 08:52:12 +00:00
test: stabilize json runtime captures (#52428) (thanks @karanuppal)
This commit is contained in:
@@ -129,6 +129,12 @@ const runtimeLogs: string[] = [];
|
||||
vi.mock("../../runtime.js", () => ({
|
||||
defaultRuntime: {
|
||||
log: (message: string) => runtimeLogs.push(message),
|
||||
writeStdout: (value: string) => {
|
||||
runtimeLogs.push(value.endsWith("\n") ? value.slice(0, -1) : value);
|
||||
},
|
||||
writeJson: (value: unknown, space = 2) => {
|
||||
runtimeLogs.push(JSON.stringify(value, null, space));
|
||||
},
|
||||
error: vi.fn(),
|
||||
exit: vi.fn(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user