@@ -26,6 +26,10 @@ const replyDispatchCtx = {
|
26 | 26 | markIdle: () => {}, |
27 | 27 | }; |
28 | 28 | |
| 29 | +function firstErrorLog(logger: { error: ReturnType<typeof vi.fn> }) { |
| 30 | +return logger.error.mock.calls[0]; |
| 31 | +} |
| 32 | + |
29 | 33 | describe("reply_dispatch hook runner", () => { |
30 | 34 | it("stops at the first handler that claims reply dispatch", async () => { |
31 | 35 | const first = vi.fn().mockResolvedValue({ |
@@ -81,7 +85,7 @@ describe("reply_dispatch hook runner", () => {
|
81 | 85 | counts: { tool: 1, block: 0, final: 0 }, |
82 | 86 | }); |
83 | 87 | expect(logger.error).toHaveBeenCalledTimes(1); |
84 | | -expect(logger.error.mock.calls.at(0)).toEqual([ |
| 88 | +expect(firstErrorLog(logger)).toEqual([ |
85 | 89 | "[hooks] reply_dispatch handler from test-plugin failed: boom", |
86 | 90 | ]); |
87 | 91 | expect(succeeding).toHaveBeenCalledTimes(1); |
@@ -118,7 +122,7 @@ describe("reply_dispatch hook runner", () => {
|
118 | 122 | counts: { tool: 1, block: 0, final: 0 }, |
119 | 123 | }); |
120 | 124 | expect(logger.error).toHaveBeenCalledTimes(1); |
121 | | -expect(logger.error.mock.calls.at(0)).toEqual([ |
| 125 | +expect(firstErrorLog(logger)).toEqual([ |
122 | 126 | "[hooks] reply_dispatch handler from test-plugin failed: timed out after 5ms", |
123 | 127 | ]); |
124 | 128 | expect(succeeding).toHaveBeenCalledTimes(1); |
|