Fix type assertion in protocol decode test

Use 'as const' on the type field to ensure the literal type "join" is
preserved, matching the ClientMessage union type requirements.
This commit is contained in:
Jared Miller 2026-01-27 21:04:17 -05:00
parent d654a1bcdf
commit 00c9a140c6
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -9,7 +9,7 @@ describe("protocol", () => {
}); });
test("decode parses valid json", () => { test("decode parses valid json", () => {
const msg = { type: "join", room: "test" }; const msg = { type: "join" as const, room: "test" };
const decoded = decode(JSON.stringify(msg)); const decoded = decode(JSON.stringify(msg));
expect(decoded).toEqual(msg); expect(decoded).toEqual(msg);
}); });