test: check reply dispatch hook warnings

This commit is contained in:
Shakker
2026-05-11 16:08:36 +01:00
parent 938b1e0225
commit 584c9bdeb2

View File

@@ -80,9 +80,10 @@ describe("reply_dispatch hook runner", () => {
queuedFinal: false,
counts: { tool: 1, block: 0, final: 0 },
});
expect(logger.error).toHaveBeenCalledWith(
expect.stringContaining("reply_dispatch handler from test-plugin failed: boom"),
);
expect(logger.error).toHaveBeenCalledTimes(1);
expect(logger.error.mock.calls[0]).toEqual([
"[hooks] reply_dispatch handler from test-plugin failed: boom",
]);
expect(succeeding).toHaveBeenCalledTimes(1);
});
@@ -116,11 +117,10 @@ describe("reply_dispatch hook runner", () => {
queuedFinal: false,
counts: { tool: 1, block: 0, final: 0 },
});
expect(logger.error).toHaveBeenCalledWith(
expect.stringContaining(
"reply_dispatch handler from test-plugin failed: timed out after 5ms",
),
);
expect(logger.error).toHaveBeenCalledTimes(1);
expect(logger.error.mock.calls[0]).toEqual([
"[hooks] reply_dispatch handler from test-plugin failed: timed out after 5ms",
]);
expect(succeeding).toHaveBeenCalledTimes(1);
} finally {
vi.useRealTimers();