mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-31 11:51:22 +00:00
fix(ci): restore cli runtime mocks and timeout exits
This commit is contained in:
@@ -34,13 +34,19 @@ const mockExit = vi.fn((code: number) => {
|
||||
throw new Error(`__exit__:${code} - ${errorMessages}`);
|
||||
});
|
||||
|
||||
vi.mock("../runtime.js", () => ({
|
||||
defaultRuntime: {
|
||||
log: (...args: unknown[]) => mockLog(...args),
|
||||
error: (...args: unknown[]) => mockError(...args),
|
||||
exit: (code: number) => mockExit(code),
|
||||
},
|
||||
}));
|
||||
vi.mock("../runtime.js", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("../runtime.js")>();
|
||||
return {
|
||||
...actual,
|
||||
defaultRuntime: {
|
||||
log: (...args: unknown[]) => mockLog(...args),
|
||||
error: (...args: unknown[]) => mockError(...args),
|
||||
writeJson: (value: unknown, space = 2) =>
|
||||
mockLog(JSON.stringify(value, null, space > 0 ? space : undefined)),
|
||||
exit: (code: number) => mockExit(code),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
function buildSnapshot(params: {
|
||||
resolved: OpenClawConfig;
|
||||
|
||||
Reference in New Issue
Block a user