]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/videos-history.ts
Add search target check params
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / videos-history.ts
index 8c079a956c455aec6964fbcced561726bae6bafb..941f6265414c2ba6383bf28f01ceae74d93fbb2c 100644 (file)
@@ -1,27 +1,23 @@
-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import * as chai from 'chai'
 import 'mocha'
 import {
   checkBadCountPagination,
   checkBadStartPagination,
-  flushTests,
-  killallServers,
+  cleanupTests,
+  flushAndRunServer,
   makeGetRequest,
   makePostBodyRequest,
   makePutBodyRequest,
-  runServer,
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../../../../shared/utils'
-
-const expect = chai.expect
+} from '../../../../shared/extra-utils'
 
 describe('Test videos history API validator', function () {
+  const myHistoryPath = '/api/v1/users/me/history/videos'
+  const myHistoryRemove = myHistoryPath + '/remove'
   let watchingPath: string
-  let myHistoryPath = '/api/v1/users/me/history/videos'
-  let myHistoryRemove = myHistoryPath + '/remove'
   let server: ServerInfo
 
   // ---------------------------------------------------------------
@@ -29,9 +25,7 @@ describe('Test videos history API validator', function () {
   before(async function () {
     this.timeout(30000)
 
-    await flushTests()
-
-    server = await runServer(1)
+    server = await flushAndRunServer(1)
 
     await setAccessTokensToServers([ server ])
 
@@ -129,11 +123,6 @@ describe('Test videos history API validator', function () {
   })
 
   after(async function () {
-    killallServers([ server ])
-
-    // Keep the logs if the test failed
-    if (this['ok']) {
-      await flushTests()
-    }
+    await cleanupTests([ server ])
   })
 })