]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/video-blacklist.ts
Merge branch 'release/2.3.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / video-blacklist.ts
index c2e9622cc41caefdaf0341d66643332fd3063915..145f43980333144d9efcdacebff12545264c0581 100644 (file)
@@ -1,30 +1,30 @@
-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
 import 'mocha'
 
 import {
+  cleanupTests,
   createUser,
   doubleFollow,
   flushAndRunMultipleServers,
-  flushTests,
   getBlacklistedVideosList,
   getVideo,
   getVideoWithToken,
-  killallServers,
   makePostBodyRequest,
   makePutBodyRequest,
   removeVideoFromBlacklist,
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo,
-  userLogin, waitJobs
+  userLogin,
+  waitJobs
 } from '../../../../shared/extra-utils'
 import {
   checkBadCountPagination,
   checkBadSortPagination,
   checkBadStartPagination
 } from '../../../../shared/extra-utils/requests/check-api-params'
-import { VideoDetails, VideoBlacklistType } from '../../../../shared/models/videos'
+import { VideoBlacklistType, VideoDetails } from '../../../../shared/models/videos'
 import { expect } from 'chai'
 
 describe('Test video blacklist API validators', function () {
@@ -39,7 +39,6 @@ describe('Test video blacklist API validators', function () {
   before(async function () {
     this.timeout(120000)
 
-    await flushTests()
     servers = await flushAndRunMultipleServers(2)
 
     await setAccessTokensToServers(servers)
@@ -48,14 +47,14 @@ describe('Test video blacklist API validators', function () {
     {
       const username = 'user1'
       const password = 'my super password'
-      await createUser({ url: servers[ 0 ].url, accessToken: servers[ 0 ].accessToken, username: username, password: password })
+      await createUser({ url: servers[0].url, accessToken: servers[0].accessToken, username: username, password: password })
       userAccessToken1 = await userLogin(servers[0], { username, password })
     }
 
     {
       const username = 'user2'
       const password = 'my super password'
-      await createUser({ url: servers[ 0 ].url, accessToken: servers[ 0 ].accessToken, username: username, password: password })
+      await createUser({ url: servers[0].url, accessToken: servers[0].accessToken, username: username, password: password })
       userAccessToken2 = await userLogin(servers[0], { username, password })
     }
 
@@ -120,7 +119,7 @@ describe('Test video blacklist API validators', function () {
 
     it('Should succeed with the correct params', async function () {
       const path = basePath + servers[0].video.uuid + '/blacklist'
-      const fields = { }
+      const fields = {}
 
       await makePostBodyRequest({ url: servers[0].url, path, token: servers[0].accessToken, fields, statusCodeExpected: 204 })
     })
@@ -249,11 +248,6 @@ describe('Test video blacklist API validators', function () {
   })
 
   after(async function () {
-    killallServers(servers)
-
-    // Keep the logs if the test failed
-    if (this['ok']) {
-      await flushTests()
-    }
+    await cleanupTests(servers)
   })
 })