aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/check-params/accounts.ts6
-rw-r--r--server/tests/api/check-params/blocklist.ts32
2 files changed, 19 insertions, 19 deletions
diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.ts
index 086090533..4f79685bd 100644
--- a/server/tests/api/check-params/accounts.ts
+++ b/server/tests/api/check-params/accounts.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4 4
5import { flushTests, killallServers, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils' 5import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils'
6import { 6import {
7 checkBadCountPagination, 7 checkBadCountPagination,
8 checkBadSortPagination, 8 checkBadSortPagination,
@@ -42,7 +42,7 @@ describe('Test accounts API validators', function () {
42 }) 42 })
43 }) 43 })
44 44
45 after(function () { 45 after(async function () {
46 killallServers([ server ]) 46 await cleanupTests([ server ])
47 }) 47 })
48}) 48})
diff --git a/server/tests/api/check-params/blocklist.ts b/server/tests/api/check-params/blocklist.ts
index d815a8363..0661676ce 100644
--- a/server/tests/api/check-params/blocklist.ts
+++ b/server/tests/api/check-params/blocklist.ts
@@ -3,16 +3,16 @@
3import 'mocha' 3import 'mocha'
4 4
5import { 5import {
6 cleanupTests,
6 createUser, 7 createUser,
7 doubleFollow, 8 doubleFollow,
8 flushAndRunMultipleServers, 9 flushAndRunMultipleServers,
9 flushTests,
10 killallServers,
11 makeDeleteRequest, 10 makeDeleteRequest,
12 makeGetRequest, 11 makeGetRequest,
13 makePostBodyRequest, 12 makePostBodyRequest,
14 ServerInfo, 13 ServerInfo,
15 setAccessTokensToServers, userLogin 14 setAccessTokensToServers,
15 userLogin
16} from '../../../../shared/extra-utils' 16} from '../../../../shared/extra-utils'
17import { 17import {
18 checkBadCountPagination, 18 checkBadCountPagination,
@@ -190,7 +190,7 @@ describe('Test blocklist API validators', function () {
190 url: server.url, 190 url: server.url,
191 token: server.accessToken, 191 token: server.accessToken,
192 path, 192 path,
193 fields: { host: 'localhost:9001' }, 193 fields: { host: 'localhost:' + server.port },
194 statusCodeExpected: 409 194 statusCodeExpected: 409
195 }) 195 })
196 }) 196 })
@@ -200,7 +200,7 @@ describe('Test blocklist API validators', function () {
200 url: server.url, 200 url: server.url,
201 token: server.accessToken, 201 token: server.accessToken,
202 path, 202 path,
203 fields: { host: 'localhost:9002' }, 203 fields: { host: 'localhost:' + servers[1].port },
204 statusCodeExpected: 204 204 statusCodeExpected: 204
205 }) 205 })
206 }) 206 })
@@ -210,7 +210,7 @@ describe('Test blocklist API validators', function () {
210 it('Should fail with an unauthenticated user', async function () { 210 it('Should fail with an unauthenticated user', async function () {
211 await makeDeleteRequest({ 211 await makeDeleteRequest({
212 url: server.url, 212 url: server.url,
213 path: path + '/localhost:9002', 213 path: path + '/localhost:' + servers[1].port,
214 statusCodeExpected: 401 214 statusCodeExpected: 401
215 }) 215 })
216 }) 216 })
@@ -227,7 +227,7 @@ describe('Test blocklist API validators', function () {
227 it('Should succeed with the correct params', async function () { 227 it('Should succeed with the correct params', async function () {
228 await makeDeleteRequest({ 228 await makeDeleteRequest({
229 url: server.url, 229 url: server.url,
230 path: path + '/localhost:9002', 230 path: path + '/localhost:' + servers[1].port,
231 token: server.accessToken, 231 token: server.accessToken,
232 statusCodeExpected: 204 232 statusCodeExpected: 204
233 }) 233 })
@@ -400,7 +400,7 @@ describe('Test blocklist API validators', function () {
400 await makePostBodyRequest({ 400 await makePostBodyRequest({
401 url: server.url, 401 url: server.url,
402 path, 402 path,
403 fields: { host: 'localhost:9002' }, 403 fields: { host: 'localhost:' + servers[1].port },
404 statusCodeExpected: 401 404 statusCodeExpected: 401
405 }) 405 })
406 }) 406 })
@@ -410,7 +410,7 @@ describe('Test blocklist API validators', function () {
410 url: server.url, 410 url: server.url,
411 token: userAccessToken, 411 token: userAccessToken,
412 path, 412 path,
413 fields: { host: 'localhost:9002' }, 413 fields: { host: 'localhost:' + servers[1].port },
414 statusCodeExpected: 403 414 statusCodeExpected: 403
415 }) 415 })
416 }) 416 })
@@ -430,7 +430,7 @@ describe('Test blocklist API validators', function () {
430 url: server.url, 430 url: server.url,
431 token: server.accessToken, 431 token: server.accessToken,
432 path, 432 path,
433 fields: { host: 'localhost:9001' }, 433 fields: { host: 'localhost:' + server.port },
434 statusCodeExpected: 409 434 statusCodeExpected: 409
435 }) 435 })
436 }) 436 })
@@ -440,7 +440,7 @@ describe('Test blocklist API validators', function () {
440 url: server.url, 440 url: server.url,
441 token: server.accessToken, 441 token: server.accessToken,
442 path, 442 path,
443 fields: { host: 'localhost:9002' }, 443 fields: { host: 'localhost:' + servers[1].port },
444 statusCodeExpected: 204 444 statusCodeExpected: 204
445 }) 445 })
446 }) 446 })
@@ -450,7 +450,7 @@ describe('Test blocklist API validators', function () {
450 it('Should fail with an unauthenticated user', async function () { 450 it('Should fail with an unauthenticated user', async function () {
451 await makeDeleteRequest({ 451 await makeDeleteRequest({
452 url: server.url, 452 url: server.url,
453 path: path + '/localhost:9002', 453 path: path + '/localhost:' + servers[1].port,
454 statusCodeExpected: 401 454 statusCodeExpected: 401
455 }) 455 })
456 }) 456 })
@@ -458,7 +458,7 @@ describe('Test blocklist API validators', function () {
458 it('Should fail with a user without the appropriate rights', async function () { 458 it('Should fail with a user without the appropriate rights', async function () {
459 await makeDeleteRequest({ 459 await makeDeleteRequest({
460 url: server.url, 460 url: server.url,
461 path: path + '/localhost:9002', 461 path: path + '/localhost:' + servers[1].port,
462 token: userAccessToken, 462 token: userAccessToken,
463 statusCodeExpected: 403 463 statusCodeExpected: 403
464 }) 464 })
@@ -476,7 +476,7 @@ describe('Test blocklist API validators', function () {
476 it('Should succeed with the correct params', async function () { 476 it('Should succeed with the correct params', async function () {
477 await makeDeleteRequest({ 477 await makeDeleteRequest({
478 url: server.url, 478 url: server.url,
479 path: path + '/localhost:9002', 479 path: path + '/localhost:' + servers[1].port,
480 token: server.accessToken, 480 token: server.accessToken,
481 statusCodeExpected: 204 481 statusCodeExpected: 204
482 }) 482 })
@@ -485,7 +485,7 @@ describe('Test blocklist API validators', function () {
485 }) 485 })
486 }) 486 })
487 487
488 after(function () { 488 after(async function () {
489 killallServers(servers) 489 await cleanupTests(servers)
490 }) 490 })
491}) 491})