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:
parent
d654a1bcdf
commit
00c9a140c6
1 changed files with 1 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ describe("protocol", () => {
|
|||
});
|
||||
|
||||
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));
|
||||
expect(decoded).toEqual(msg);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue