From 4ad25a3e8bcb312747ceaeffbcf8de1d66b6e3cf Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 24 May 2018 21:03:37 +0100 Subject: [PATCH] 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 --- test/ping.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ping.spec.js b/test/ping.spec.js index a80f3a9d4..231ad2a63 100644 --- a/test/ping.spec.js +++ b/test/ping.spec.js @@ -17,7 +17,7 @@ const f = require('./utils/factory') // Determine if a ping response object is a pong, or something else, like a status message function isPong (pingResponse) { - return Boolean(pingResponse && pingResponse.time) + return Boolean(pingResponse && pingResponse.success && !pingResponse.text) } describe('.ping', function () {