]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/videos-views-cleaner.ts
Use test wrapper exit function
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / videos-views-cleaner.ts
index 9f268c8e6b7f44f6f99fdc6f4e8eb467491326af..c21d46d569f58d1701b4868492d36f2267c25704 100644 (file)
@@ -7,14 +7,14 @@ import {
   flushTests,
   killallServers,
   reRunServer,
-  runServer,
+  flushAndRunServer,
   ServerInfo,
   setAccessTokensToServers,
-  uploadVideo, uploadVideoAndGetId, viewVideo, wait, countVideoViewsOf, doubleFollow, waitJobs
-} from '../../../../shared/utils'
-import { getVideosOverview } from '../../../../shared/utils/overviews/overviews'
+  uploadVideo, uploadVideoAndGetId, viewVideo, wait, countVideoViewsOf, doubleFollow, waitJobs, cleanupTests
+} from '../../../../shared/extra-utils'
+import { getVideosOverview } from '../../../../shared/extra-utils/overviews/overviews'
 import { VideosOverview } from '../../../../shared/models/overviews'
-import { listMyVideosHistory } from '../../../../shared/utils/videos/video-history'
+import { listMyVideosHistory } from '../../../../shared/extra-utils/videos/video-history'
 
 const expect = chai.expect
 
@@ -27,8 +27,6 @@ describe('Test video views cleaner', function () {
   before(async function () {
     this.timeout(50000)
 
-    await flushTests()
-
     servers = await flushAndRunMultipleServers(2)
     await setAccessTokensToServers(servers)
 
@@ -103,11 +101,6 @@ describe('Test video views cleaner', function () {
   })
 
   after(async function () {
-    killallServers(servers)
-
-    // Keep the logs if the test failed
-    if (this['ok']) {
-      await flushTests()
-    }
+    await cleanupTests(servers)
   })
 })