]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/request-schedulers.ts
Convert real world script to typescript
[github/Chocobozzz/PeerTube.git] / server / tests / api / request-schedulers.ts
index 2358ed8f73780faf6cf0e35ba2374152a6f4badd..326ed3468f14921263aa1d05e1a1cc7c9a3a85a9 100644 (file)
@@ -12,7 +12,9 @@ import {
   makeFriends,
   wait,
   setAccessTokensToServers,
-  flushAndRunMultipleServers
+  flushAndRunMultipleServers,
+  getRequestsStats,
+  killallServers
 } from '../utils'
 
 describe('Test requests schedulers stats', function () {
@@ -28,14 +30,6 @@ describe('Test requests schedulers stats', function () {
     return uploadVideo(server.url, server.accessToken, videoAttributes)
   }
 
-  function getRequestsStats (server: ServerInfo) {
-    return request(server.url)
-            .get(path)
-            .set('Accept', 'application/json')
-            .set('Authorization', 'Bearer ' + server.accessToken)
-            .expect(200)
-  }
-
   // ---------------------------------------------------------------
 
   before(async function () {
@@ -80,7 +74,7 @@ describe('Test requests schedulers stats', function () {
   })
 
   after(async function () {
-    process.kill(-servers[0].app.pid)
+    killallServers(servers)
 
     if (this['ok']) {
       await flushTests()