-
Notifications
You must be signed in to change notification settings - Fork 446
[TS] Reject handshake if connection closes before response #3000
Conversation
try { | ||
let startCompleted = false; | ||
const startPromise = hubConnection.start().then(() => startCompleted = true); | ||
expect(startCompleted).toBe(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be asserted after the await?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's asserting that startCompleted
is false. It will be true
after the await
. This is to ensure that the promise doesn't complete until the handshake is received.
|
@dotnet-bot test Windows Release x64 Build |
"@types/node": "^8.5.2", | ||
"@types/webpack": "^4.4.0", | ||
"jest": "^22.4.3", | ||
"jest": "^23.6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @Eilon. Updated devDependencies
(internal use only, not distributed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up-roved.
Updated Jest reference because I was finding it impossible to debug a test failure and found similar issues filed against Jest that have been fixed in 23.X.X. Side-effect is rejects.toThrow no longer works in some of our tests because of another bug jestjs/jest#6675. I can revert the Jest change if we want now that I fixed the test.