aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/user-notifications.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts
index c6384677e..4aab7eba4 100644
--- a/server/tests/api/check-params/user-notifications.ts
+++ b/server/tests/api/check-params/user-notifications.ts
@@ -238,7 +238,7 @@ describe('Test user notifications API validators', function () {
238 it('Should fail with no token', function (next) { 238 it('Should fail with no token', function (next) {
239 const socket = io(`http://localhost:${server.port}/user-notifications`, { reconnection: false }) 239 const socket = io(`http://localhost:${server.port}/user-notifications`, { reconnection: false })
240 240
241 socket.on('error', () => { 241 socket.on('error', function () {
242 socket.removeListener('error', this) 242 socket.removeListener('error', this)
243 socket.disconnect() 243 socket.disconnect()
244 next() 244 next()
@@ -256,7 +256,7 @@ describe('Test user notifications API validators', function () {
256 reconnection: false 256 reconnection: false
257 }) 257 })
258 258
259 socket.on('error', () => { 259 socket.on('error', function () {
260 socket.removeListener('error', this) 260 socket.removeListener('error', this)
261 socket.disconnect() 261 socket.disconnect()
262 next() 262 next()
@@ -274,9 +274,11 @@ describe('Test user notifications API validators', function () {
274 reconnection: false 274 reconnection: false
275 }) 275 })
276 276
277 const errorListener = socket.on('error', err => { 277 function errorListener (err) {
278 next(new Error('Error in connection: ' + err)) 278 next(new Error('Error in connection: ' + err))
279 }) 279 }
280
281 socket.on('error', errorListener)
280 282
281 socket.on('connect', async () => { 283 socket.on('connect', async () => {
282 socket.removeListener('error', errorListener) 284 socket.removeListener('error', errorListener)