]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/logs.ts
Add ability to disable webtorrent
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / logs.ts
index d6a40da61001b4c11cb3f3dbaf3b3086884c9da7..f9d96bcc0785089cc428ec7979c1f4aa5804ee46 100644 (file)
@@ -6,12 +6,13 @@ import {
   createUser,
   flushTests,
   killallServers,
-  runServer,
+  flushAndRunServer,
   ServerInfo,
   setAccessTokensToServers,
-  userLogin
-} from '../../../../shared/utils'
-import { makeGetRequest } from '../../../../shared/utils/requests/requests'
+  userLogin,
+  cleanupTests
+} from '../../../../shared/extra-utils'
+import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests'
 
 describe('Test logs API validators', function () {
   const path = '/api/v1/server/logs'
@@ -23,9 +24,7 @@ describe('Test logs API validators', function () {
   before(async function () {
     this.timeout(120000)
 
-    await flushTests()
-
-    server = await runServer(1)
+    server = await flushAndRunServer(1)
 
     await setAccessTokensToServers([ server ])
 
@@ -33,7 +32,7 @@ describe('Test logs API validators', function () {
       username: 'user1',
       password: 'my 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)
   })
 
@@ -107,11 +106,6 @@ describe('Test logs API validators', function () {
   })
 
   after(async function () {
-    killallServers([ server ])
-
-    // Keep the logs if the test failed
-    if (this['ok']) {
-      await flushTests()
-    }
+    await cleanupTests([ server ])
   })
 })