From b80f5bdae8c2de4101557c6fd844b091b2e4c337 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 24 Mar 2021 21:03:48 +0000 Subject: [PATCH] bugfix/tests/scaling: Socket query test fix (#4974) fix socketio test where res.req is not available. --- src/tests/backend/specs/socketio.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tests/backend/specs/socketio.js b/src/tests/backend/specs/socketio.js index dbd633add..9899856e0 100644 --- a/src/tests/backend/specs/socketio.js +++ b/src/tests/backend/specs/socketio.js @@ -52,7 +52,10 @@ const connect = async (res) => { ([name, cookie]) => `${name}=${encodeURIComponent(cookie.value)}`).join('; '); logger.debug('socket.io connecting...'); - const padId = res.req.path.split('/p/')[1]; + let padId = null; + if (res) { + padId = res.req.path.split('/p/')[1]; + } const socket = io(`${common.baseUrl}/`, { forceNew: true, // Different tests will have different query parameters. path: '/socket.io',