diff --git a/src/crestodian/audit.test.ts b/src/crestodian/audit.test.ts index 7506c0411fee..43a2ac320252 100644 --- a/src/crestodian/audit.test.ts +++ b/src/crestodian/audit.test.ts @@ -29,11 +29,10 @@ describe("Crestodian audit log", () => { expect(auditPath).toBe(resolveCrestodianAuditPath()); const lines = (await fs.readFile(auditPath, "utf8")).trim().split("\n"); expect(lines).toHaveLength(1); - expect(JSON.parse(lines[0] ?? "{}")).toMatchObject({ - operation: "config.setDefaultModel", - summary: "Set default model to openai/gpt-5.2", - configHashBefore: "before", - configHashAfter: "after", - }); + const entry = JSON.parse(lines[0] ?? "{}") as Record; + expect(entry.operation).toBe("config.setDefaultModel"); + expect(entry.summary).toBe("Set default model to openai/gpt-5.2"); + expect(entry.configHashBefore).toBe("before"); + expect(entry.configHashAfter).toBe("after"); }); }); diff --git a/src/crestodian/overview.test.ts b/src/crestodian/overview.test.ts index ab37aa2729d8..b92cde16b30b 100644 --- a/src/crestodian/overview.test.ts +++ b/src/crestodian/overview.test.ts @@ -52,19 +52,15 @@ describe("loadCrestodianOverview", () => { }, }); - expect(overview.config).toMatchObject({ - exists: true, - valid: true, - }); + expect(overview.config.exists).toBe(true); + expect(overview.config.valid).toBe(true); expect(overview.defaultAgentId).toBe("main"); expect(overview.defaultModel).toBe("openai/gpt-5.2"); expect(overview.agents.map((agent) => agent.id)).toEqual(["main", "work"]); expect(overview.tools.codex.found).toBe(true); expect(overview.tools.claude.found).toBe(false); - expect(overview.gateway).toMatchObject({ - url: "ws://127.0.0.1:19001", - reachable: false, - }); + expect(overview.gateway.url).toBe("ws://127.0.0.1:19001"); + expect(overview.gateway.reachable).toBe(false); expect(overview.references.docsPath).toMatch(/docs$/); expect(overview.references.sourceUrl).toBe("https://github.com/openclaw/openclaw"); expect(formatCrestodianOverview(overview)).toContain( diff --git a/src/crestodian/rescue-channel.live.test.ts b/src/crestodian/rescue-channel.live.test.ts index b0a10b9f6653..b35066d22020 100644 --- a/src/crestodian/rescue-channel.live.test.ts +++ b/src/crestodian/rescue-channel.live.test.ts @@ -98,11 +98,14 @@ describeLive("Crestodian live rescue channel smoke", () => { ); const config = JSON.parse(await fs.readFile(configPath, "utf8")) as OpenClawConfig; - expect(config.agents?.defaults?.model).toMatchObject({ primary: "openai/gpt-5.5" }); + const defaultModel = config.agents?.defaults?.model; + expect(typeof defaultModel).toBe("object"); + expect(defaultModel).not.toBeNull(); + expect((defaultModel as { primary?: unknown }).primary).toBe("openai/gpt-5.5"); const auditPath = path.join(tempDir, "audit", "crestodian.jsonl"); const auditLines = (await fs.readFile(auditPath, "utf8")).trim().split("\n"); - expect(auditLines).toEqual( - expect.arrayContaining([expect.stringContaining('"operation":"config.setDefaultModel"')]), + expect(auditLines.some((line) => line.includes('"operation":"config.setDefaultModel"'))).toBe( + true, ); }); }); diff --git a/src/crestodian/tui-backend.test.ts b/src/crestodian/tui-backend.test.ts index fe3cd9e959f3..7ac4da3b859e 100644 --- a/src/crestodian/tui-backend.test.ts +++ b/src/crestodian/tui-backend.test.ts @@ -55,13 +55,20 @@ describe("runCrestodianTui", () => { ); expect(runTuiCalls).toBe(1); - expect(runTuiOptions).toMatchObject({ - local: true, - session: "agent:crestodian:main", - historyLimit: 200, - config: {}, - title: "openclaw crestodian", - }); - expect(runTuiOptions).toMatchObject({ backend: expect.any(Object) }); + const options = runTuiOptions as { + local?: boolean; + session?: string; + historyLimit?: number; + config?: unknown; + title?: string; + backend?: unknown; + }; + expect(options.local).toBe(true); + expect(options.session).toBe("agent:crestodian:main"); + expect(options.historyLimit).toBe(200); + expect(options.config).toEqual({}); + expect(options.title).toBe("openclaw crestodian"); + expect(typeof options.backend).toBe("object"); + expect(options.backend).not.toBeNull(); }); });