]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/videos-history.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / videos-history.ts
index f7d3a6aeb0ab0717c1ed9a2f951aee0d09de4100..6f90e9a57b9a829fd44fdd094c3e1035bd0d0a05 100644 (file)
@@ -1,14 +1,15 @@
-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
 import * as chai from 'chai'
 import 'mocha'
 import {
+  cleanupTests,
   createUser,
-  flushTests,
+  flushAndRunServer,
   getVideosListWithToken,
   getVideoWithToken,
-  killallServers, reRunServer,
-  runServer,
+  killallServers,
+  reRunServer,
   searchVideoWithToken,
   ServerInfo,
   setAccessTokensToServers,
@@ -16,9 +17,9 @@ import {
   uploadVideo,
   userLogin,
   wait
-} from '../../../../shared/utils'
+} from '../../../../shared/extra-utils'
 import { Video, VideoDetails } from '../../../../shared/models/videos'
-import { listMyVideosHistory, removeMyVideosHistory, userWatchVideo } from '../../../../shared/utils/videos/video-history'
+import { listMyVideosHistory, removeMyVideosHistory, userWatchVideo } from '../../../../shared/extra-utils/videos/video-history'
 
 const expect = chai.expect
 
@@ -33,9 +34,7 @@ describe('Test videos history', function () {
   before(async function () {
     this.timeout(30000)
 
-    await flushTests()
-
-    server = await runServer(1)
+    server = await flushAndRunServer(1)
 
     await setAccessTokensToServers([ server ])
 
@@ -58,7 +57,7 @@ describe('Test videos history', function () {
       username: 'user_1',
       password: 'super password'
     }
-    await createUser(server.url, server.accessToken, user.username, user.password)
+    await createUser({ url: server.url, accessToken: server.accessToken, username: user.username, password: user.password })
     userAccessToken = await userLogin(server, user)
   })
 
@@ -223,11 +222,6 @@ describe('Test videos history', function () {
   })
 
   after(async function () {
-    killallServers([ server ])
-
-    // Keep the logs if the test failed
-    if (this['ok']) {
-      await flushTests()
-    }
+    await cleanupTests([ server ])
   })
 })