]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-comments.ts
Merge branch 'feature/parallel-tests' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-comments.ts
index 50224ee473b1ab6216b36caa368e1df8c6d580f8..82182cc7cb90da36c82f1bc4d29f6fd20ed4a093 100644 (file)
@@ -3,11 +3,9 @@
 import * as chai from 'chai'
 import 'mocha'
 import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
-import { testImage } from '../../../../shared/extra-utils'
+import { cleanupTests, testImage } from '../../../../shared/extra-utils'
 import {
   dateIsValid,
-  flushTests,
-  killallServers,
   flushAndRunServer,
   ServerInfo,
   setAccessTokensToServers,
@@ -68,8 +66,8 @@ describe('Test video comments', function () {
     expect(comment.videoId).to.equal(videoId)
     expect(comment.id).to.equal(comment.threadId)
     expect(comment.account.name).to.equal('root')
-    expect(comment.account.host).to.equal('localhost:9001')
-    expect(comment.account.url).to.equal('http://localhost:9001/accounts/root')
+    expect(comment.account.host).to.equal('localhost:' + server.port)
+    expect(comment.account.url).to.equal('http://localhost:' + server.port + '/accounts/root')
     expect(comment.totalReplies).to.equal(0)
     expect(dateIsValid(comment.createdAt as string)).to.be.true
     expect(dateIsValid(comment.updatedAt as string)).to.be.true
@@ -88,7 +86,7 @@ describe('Test video comments', function () {
     expect(comment.videoId).to.equal(videoId)
     expect(comment.id).to.equal(comment.threadId)
     expect(comment.account.name).to.equal('root')
-    expect(comment.account.host).to.equal('localhost:9001')
+    expect(comment.account.host).to.equal('localhost:' + server.port)
 
     await testImage(server.url, 'avatar-resized', comment.account.avatar.path, '.png')
 
@@ -199,7 +197,7 @@ describe('Test video comments', function () {
     expect(res.body.data[1].totalReplies).to.equal(0)
   })
 
-  after(function () {
-    killallServers([ server ])
+  after(async function () {
+    await cleanupTests([ server ])
   })
 })