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"
This commit is contained in:
parent
f2f030e479
commit
d11673fc2d
1 changed files with 0 additions and 7 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue