Register callback before start (#4581)
This commit is contained in:
parent
4950495dc4
commit
74dbb4ff4f
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue