test: restore runtime-aware cli mocks

This commit is contained in:
Peter Steinberger
2026-03-22 18:28:42 -07:00
parent c43bfcbbec
commit 75835fc664
16 changed files with 110 additions and 81 deletions

View File

@@ -61,7 +61,7 @@ describe("memory cli", () => {
function spyRuntimeLogs() {
const logSpy = vi.spyOn(defaultRuntime, "log").mockImplementation(() => {});
vi.spyOn(defaultRuntime, "writeJson").mockImplementation((value: unknown, space = 2) => {
logSpy(JSON.stringify(value, null, space));
logSpy(JSON.stringify(value, null, space > 0 ? space : undefined));
});
return logSpy;
}