From d8c1c3dee15a5a9ee21e8432e6a42dc1fc8ca65d Mon Sep 17 00:00:00 2001 From: Hikari Date: Sat, 7 Feb 2026 00:19:55 -0800 Subject: [PATCH] fix: correct type assertion in stateMapper test The test for unknown result subtype was using an invalid subtype value directly, which caused a TypeScript error. Changed to use a type assertion to properly test the unknown subtype case, matching the pattern used for testing unknown message types. This fix ensures all TypeScript checks pass whilst still testing the edge case behaviour for unexpected subtype values. --- src/lib/utils/stateMapper.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/utils/stateMapper.test.ts b/src/lib/utils/stateMapper.test.ts index 50ca8a1..e723330 100644 --- a/src/lib/utils/stateMapper.test.ts +++ b/src/lib/utils/stateMapper.test.ts @@ -267,10 +267,10 @@ describe("stateMapper", () => { }); it("returns null for result with unknown subtype", () => { - const message: ClaudeStreamMessage = { + const message = { type: "result", subtype: "unknown_type", - }; + } as unknown as ClaudeStreamMessage; expect(mapMessageToState(message)).toBeNull(); });