From d11673fc2d39743b13719104042500cbb58278c1 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Mon, 28 Apr 2025 18:01:14 -0400 Subject: [PATCH] Add client/server version negotiation tests without mocks * In src/client/index.test.ts added tests: - "should connect new client to old, supported server version" - should negotiate version when client is old, and newer server supports its version" - "should throw when client is old, and server doesn't support its version" --- src/client/index.test.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/client/index.test.ts b/src/client/index.test.ts index 6e1c442f..5b4f332f 100644 --- a/src/client/index.test.ts +++ b/src/client/index.test.ts @@ -222,8 +222,6 @@ test("should connect new client to old, supported server version", async () => { server.connect(serverTransport), ]); - // These should work - // Connection should succeed with the older version expect(client.getServerVersion()).toEqual({ name: "old server", version: "1.0", @@ -287,8 +285,6 @@ test("should negotiate version when client is old, and newer server supports its server.connect(serverTransport), ]); - // These should work - // Connection should succeed with the older version expect(client.getServerVersion()).toEqual({ name: "new server", version: "1.0", @@ -348,9 +344,6 @@ test("should throw when client is old, and server doesn't support its version", }, ); - let closed = false; - clientTransport.onerror = () => {closed = true}; - await Promise.all([ expect(client.connect(clientTransport)).rejects.toThrow( "Server's protocol version is not supported: FUTURE_VERSION"