bugfix/tests/scaling: Socket query test fix (#4974)

fix socketio test where res.req is not available.
pr-4979-for-frontend-tests
John McLear 2021-03-24 21:03:48 +00:00 committed by GitHub
parent 2b98b930d7
commit b80f5bdae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -52,7 +52,10 @@ const connect = async (res) => {
([name, cookie]) => `${name}=${encodeURIComponent(cookie.value)}`).join('; '); ([name, cookie]) => `${name}=${encodeURIComponent(cookie.value)}`).join('; ');
logger.debug('socket.io connecting...'); 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}/`, { const socket = io(`${common.baseUrl}/`, {
forceNew: true, // Different tests will have different query parameters. forceNew: true, // Different tests will have different query parameters.
path: '/socket.io', path: '/socket.io',