Guard websocket close metadata uniqueness in contracts tests

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 08:11:46 +00:00
1 parent dfd11e6140
commit 0302f61b88
1 file changed
+9
+9
View File
@@ -64,4 +64,13 @@ describe("ws close metadata", () => {
expect(WS_CLOSE_CODES.replacedByNewClient).toBe(4000);
expect(WS_CLOSE_REASONS.replacedByNewClient).toBe("replaced-by-new-client");
});
it("keeps close codes and reasons unique", () => {
expect(
new Set([WS_CLOSE_CODES.unauthorized, WS_CLOSE_CODES.replacedByNewClient]).size,
).toBe(2);
expect(
new Set([WS_CLOSE_REASONS.unauthorized, WS_CLOSE_REASONS.replacedByNewClient]).size,
).toBe(2);
});
});