test: tighten fallback json assertion

This commit is contained in:
Shakker
2026-05-08 20:43:23 +01:00
parent 91d8e55679
commit 7645da2643

View File

@@ -402,7 +402,8 @@ describe("agentCliCommand", () => {
);
expect(loggingState.forceConsoleToStderr).toBe(true);
expect(jsonRuntime.log).toHaveBeenCalledTimes(1);
const payload = JSON.parse(String(jsonRuntime.log.mock.calls[0]?.[0]));
const jsonPayload = requireFirstCallArg(jsonRuntime.log, "json runtime log");
const payload = JSON.parse(String(jsonPayload));
expect(payload).toMatchObject({
payloads: [{ text: "local" }],
meta: {