Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 4ad25a3

Browse files
committed
fix: correctly differentiate pong responses
Investigation discovered that pong responses CAN have `time: 0` (they can be very quick). Previously pong messages were differentiated by time greater than 0, but considering it can be 0 this was incorrect. License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 7ee17ba commit 4ad25a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/ping.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const f = require('./utils/factory')
1717

1818
// Determine if a ping response object is a pong, or something else, like a status message
1919
function isPong (pingResponse) {
20-
return Boolean(pingResponse && pingResponse.time)
20+
return Boolean(pingResponse && pingResponse.success && !pingResponse.text)
2121
}
2222

2323
describe('.ping', function () {

0 commit comments

Comments
 (0)