aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/user-notifications.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-24 15:10:37 +0200
committerChocobozzz <me@florianbigard.com>2019-04-24 16:26:25 +0200
commit7c3b79768bd174b22154e8d2df0b1211e01ee56a (patch)
tree9e45c9302083f0438f7ea174f5fb7d6042be5712 /server/tests/api/check-params/user-notifications.ts
parent913b1d71e630d5a959c763bf565a171b4dc61434 (diff)
downloadPeerTube-7c3b79768bd174b22154e8d2df0b1211e01ee56a.tar.gz
PeerTube-7c3b79768bd174b22154e8d2df0b1211e01ee56a.tar.zst
PeerTube-7c3b79768bd174b22154e8d2df0b1211e01ee56a.zip
Use test wrapper exit function
Diffstat (limited to 'server/tests/api/check-params/user-notifications.ts')
-rw-r--r--server/tests/api/check-params/user-notifications.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts
index 32619d7e1..14ee20d45 100644
--- a/server/tests/api/check-params/user-notifications.ts
+++ b/server/tests/api/check-params/user-notifications.ts
@@ -4,13 +4,12 @@ import 'mocha'
4import * as io from 'socket.io-client' 4import * as io from 'socket.io-client'
5 5
6import { 6import {
7 flushTests, 7 cleanupTests,
8 flushAndRunServer,
8 immutableAssign, 9 immutableAssign,
9 killallServers,
10 makeGetRequest, 10 makeGetRequest,
11 makePostBodyRequest, 11 makePostBodyRequest,
12 makePutBodyRequest, 12 makePutBodyRequest,
13 flushAndRunServer,
14 ServerInfo, 13 ServerInfo,
15 setAccessTokensToServers, 14 setAccessTokensToServers,
16 wait 15 wait
@@ -234,7 +233,7 @@ describe('Test user notifications API validators', function () {
234 233
235 describe('When connecting to my notification socket', function () { 234 describe('When connecting to my notification socket', function () {
236 it('Should fail with no token', function (next) { 235 it('Should fail with no token', function (next) {
237 const socket = io('http://localhost:9001/user-notifications', { reconnection: false }) 236 const socket = io(`http://localhost:${server.port}/user-notifications`, { reconnection: false })
238 237
239 socket.on('error', () => { 238 socket.on('error', () => {
240 socket.removeListener('error', this) 239 socket.removeListener('error', this)
@@ -249,7 +248,7 @@ describe('Test user notifications API validators', function () {
249 }) 248 })
250 249
251 it('Should fail with an invalid token', function (next) { 250 it('Should fail with an invalid token', function (next) {
252 const socket = io('http://localhost:9001/user-notifications', { 251 const socket = io(`http://localhost:${server.port}/user-notifications`, {
253 query: { accessToken: 'bad_access_token' }, 252 query: { accessToken: 'bad_access_token' },
254 reconnection: false 253 reconnection: false
255 }) 254 })
@@ -267,7 +266,7 @@ describe('Test user notifications API validators', function () {
267 }) 266 })
268 267
269 it('Should success with the correct token', function (next) { 268 it('Should success with the correct token', function (next) {
270 const socket = io('http://localhost:9001/user-notifications', { 269 const socket = io(`http://localhost:${server.port}/user-notifications`, {
271 query: { accessToken: server.accessToken }, 270 query: { accessToken: server.accessToken },
272 reconnection: false 271 reconnection: false
273 }) 272 })
@@ -286,7 +285,7 @@ describe('Test user notifications API validators', function () {
286 }) 285 })
287 }) 286 })
288 287
289 after(function () { 288 after(async function () {
290 killallServers([ server ]) 289 await cleanupTests([ server ])
291 }) 290 })
292}) 291})