]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/mock-servers/mock-object-storage.ts
Add channel filters for my videos/followers
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / mock-servers / mock-object-storage.ts
index f1c5a612388136a4fdce3f06028a7b1bb2d703ef..144f2819dc0e945140e90934753e27e0504cc233 100644 (file)
@@ -4,6 +4,7 @@ import { Server } from 'http'
 import { pipeline } from 'stream'
 import { randomInt } from '@shared/core-utils'
 import { ObjectStorageCommand } from '../server'
+import { terminateServer } from './utils'
 
 export class MockObjectStorage {
   private server: Server
@@ -31,12 +32,12 @@ export class MockObjectStorage {
         )
       })
 
-      const port = 42301 + randomInt(1, 100)
+      const port = 44000 + randomInt(1, 1000)
       this.server = app.listen(port, () => res(port))
     })
   }
 
   terminate () {
-    if (this.server) this.server.close()
+    return terminateServer(this.server)
   }
 }