mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 07:42:04 +00:00
test: stabilize json runtime captures (#52428) (thanks @karanuppal)
This commit is contained in:
parent
a2999c6cfb
commit
aaa6068c08
21 changed files with 103 additions and 11 deletions
|
|
@ -15,6 +15,12 @@ const createDefaultDepsMock = vi.fn(() => ({ deps: true }));
|
|||
const runtime = {
|
||||
log: vi.fn(),
|
||||
error: vi.fn(),
|
||||
writeStdout: vi.fn((value: string) => {
|
||||
runtime.log(value.endsWith("\n") ? value.slice(0, -1) : value);
|
||||
}),
|
||||
writeJson: vi.fn((value: unknown, space = 2) => {
|
||||
runtime.log(JSON.stringify(value, null, space));
|
||||
}),
|
||||
exit: vi.fn(),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,12 @@ const backupVerifyCommand = vi.fn();
|
|||
const runtime = {
|
||||
log: vi.fn(),
|
||||
error: vi.fn(),
|
||||
writeStdout: vi.fn((value: string) => {
|
||||
runtime.log(value.endsWith("\n") ? value.slice(0, -1) : value);
|
||||
}),
|
||||
writeJson: vi.fn((value: unknown, space = 2) => {
|
||||
runtime.log(JSON.stringify(value, null, space));
|
||||
}),
|
||||
exit: vi.fn(),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,12 @@ const setVerbose = vi.fn();
|
|||
const runtime = {
|
||||
log: vi.fn(),
|
||||
error: vi.fn(),
|
||||
writeStdout: vi.fn((value: string) => {
|
||||
runtime.log(value.endsWith("\n") ? value.slice(0, -1) : value);
|
||||
}),
|
||||
writeJson: vi.fn((value: unknown, space = 2) => {
|
||||
runtime.log(JSON.stringify(value, null, space));
|
||||
}),
|
||||
exit: vi.fn(),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue