diff --git a/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts b/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts index 99944c1da2..e212ad9a7f 100644 --- a/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts +++ b/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts @@ -634,16 +634,16 @@ describe("hubConnection", () => { }); if (transportType !== HttpTransportType.LongPolling) { - it("terminates if no messages received within timeout interval", (done) => { + it("terminates if no messages received within timeout interval", async (done) => { const hubConnection = getConnectionBuilder(transportType).build(); hubConnection.serverTimeoutInMilliseconds = 100; - hubConnection.start().then(() => { - hubConnection.onclose((error) => { - expect(error).toEqual(new Error("Server timeout elapsed without receiving a message from the server.")); - done(); - }); + hubConnection.onclose((error) => { + expect(error).toEqual(new Error("Server timeout elapsed without receiving a message from the server.")); + done(); }); + + await hubConnection.start(); }); }