From 38ab7f84270a4a65deb734fe0ff7656dee92eb7e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 07:35:31 +0100 Subject: [PATCH] test: tighten fast json status assertions --- src/commands/status.scan.fast-json.test.ts | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/commands/status.scan.fast-json.test.ts b/src/commands/status.scan.fast-json.test.ts index 496d7f76352..3cdedb2dc3f 100644 --- a/src/commands/status.scan.fast-json.test.ts +++ b/src/commands/status.scan.fast-json.test.ts @@ -104,9 +104,11 @@ describe("scanStatusJsonFast", () => { await scanStatusJsonFast({}, {} as never); - expect(mocks.getStatusSummary).toHaveBeenCalledWith( - expect.objectContaining({ includeChannelSummary: false }), - ); + expect(mocks.getStatusSummary).toHaveBeenCalledOnce(); + const summaryOptions = mocks.getStatusSummary.mock.calls[0]?.[0] as + | { includeChannelSummary?: unknown } + | undefined; + expect(summaryOptions?.includeChannelSummary).toBe(false); }); it("skips memory inspection for the lean status --json fast path", async () => { @@ -114,7 +116,7 @@ describe("scanStatusJsonFast", () => { expect(result.memory).toBeNull(); expect(mocks.hasPotentialConfiguredChannels).toHaveBeenCalledWith( - expect.any(Object), + createStatusMemorySearchConfig(), process.env, { includePersistedAuthState: false }, ); @@ -125,16 +127,16 @@ describe("scanStatusJsonFast", () => { it("restores memory inspection when --all is requested", async () => { const result = await scanStatusJsonFast({ all: true }, {} as never); - expect(result.memory).toEqual(expect.objectContaining({ agentId: "main" })); + expect(result.memory).toStrictEqual({ + agentId: "main", + files: 0, + chunks: 0, + dirty: false, + }); expect(mocks.resolveMemorySearchConfig).toHaveBeenCalled(); - expect(mocks.getMemorySearchManager).toHaveBeenCalledWith({ - cfg: expect.objectContaining({ - agents: expect.objectContaining({ - defaults: expect.objectContaining({ - memorySearch: expect.any(Object), - }), - }), - }), + expect(mocks.getMemorySearchManager).toHaveBeenCalledOnce(); + expect(mocks.getMemorySearchManager.mock.calls[0]?.[0]).toStrictEqual({ + cfg: createStatusMemorySearchConfig(), agentId: "main", purpose: "status", });