chore: Fix types in tests 25/N.

This commit is contained in:
cpojer
2026-02-17 14:31:02 +09:00
parent 600022cdcc
commit 6e5df1dc0f
16 changed files with 118 additions and 78 deletions

View File

@@ -47,8 +47,11 @@ describe("compaction hook wiring", () => {
expect(hookMocks.runner.runBeforeCompaction).toHaveBeenCalledTimes(1);
const [event] = hookMocks.runner.runBeforeCompaction.mock.calls[0];
expect(event.messageCount).toBe(3);
const beforeCalls = hookMocks.runner.runBeforeCompaction.mock.calls as unknown as Array<
[unknown]
>;
const event = beforeCalls[0]?.[0] as { messageCount?: number } | undefined;
expect(event?.messageCount).toBe(3);
});
it("calls runAfterCompaction when willRetry is false", async () => {
@@ -75,9 +78,14 @@ describe("compaction hook wiring", () => {
expect(hookMocks.runner.runAfterCompaction).toHaveBeenCalledTimes(1);
const [event] = hookMocks.runner.runAfterCompaction.mock.calls[0];
expect(event.messageCount).toBe(2);
expect(event.compactedCount).toBe(1);
const afterCalls = hookMocks.runner.runAfterCompaction.mock.calls as unknown as Array<
[unknown]
>;
const event = afterCalls[0]?.[0] as
| { messageCount?: number; compactedCount?: number }
| undefined;
expect(event?.messageCount).toBe(2);
expect(event?.compactedCount).toBe(1);
});
it("does not call runAfterCompaction when willRetry is true", async () => {