From 2ae2c8013cf754efc2fd8897098780d63b9f4026 Mon Sep 17 00:00:00 2001 From: "claude (blind_chess)" Date: Mon, 18 May 2026 20:23:17 -0400 Subject: [PATCH] test(shared): cover null-valued entry in deserializePhantoms Adds a null-valued entry under a valid square key (d3) to the 'keeps valid entries and drops invalid ones' fixture, proving the typeof/null guard branch in deserializePhantoms is exercised. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/shared/test/phantoms.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/shared/test/phantoms.test.ts b/packages/shared/test/phantoms.test.ts index 881706c..98cd7d5 100644 --- a/packages/shared/test/phantoms.test.ts +++ b/packages/shared/test/phantoms.test.ts @@ -32,6 +32,7 @@ describe('deserializePhantoms', () => { zz: { color: 'b', type: 'p' }, // invalid square a1: { color: 'x', type: 'p' }, // invalid colour b2: { color: 'b', type: 'z' }, // invalid type + d3: null, // valid square, null value }); expect(deserializePhantoms(raw)).toEqual({ e5: { color: 'b', type: 'n' } }); });