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',