From 3cb4edf19e119808b56f09e635977b33214c7318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 22 May 2023 10:20:56 -0400 Subject: [PATCH] test: log socket.io error dont call callback twice --- test/helpers/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/helpers/index.js b/test/helpers/index.js index 4adcb1b0dd..aea7761e17 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -111,12 +111,17 @@ helpers.connectSocketIO = function (res, csrf_token, callback) { _csrf: csrf_token, }, }); - + let error; socket.on('connect', () => { + if (error) { + return; + } callback(null, socket); }); socket.on('error', (err) => { + error = err; + console.log('socket.io error', err.stack); callback(err); }); };