]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/activitypub/client.ts
Merge branch 'release/1.4.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / activitypub / client.ts
index 52e7e27f8bb6cce5f9cce61b9f999af22402fa5f..34c6be49be9be139a418fa1b54baf16340d4a5ab 100644 (file)
@@ -3,6 +3,7 @@
 import * as chai from 'chai'
 import 'mocha'
 import {
+  cleanupTests,
   doubleFollow,
   flushAndRunMultipleServers,
   flushTests,
@@ -22,8 +23,6 @@ describe('Test activitypub', function () {
   before(async function () {
     this.timeout(30000)
 
-    await flushTests()
-
     servers = await flushAndRunMultipleServers(2)
 
     await setAccessTokensToServers(servers)
@@ -41,7 +40,7 @@ describe('Test activitypub', function () {
     const object = res.body
 
     expect(object.type).to.equal('Person')
-    expect(object.id).to.equal('http://localhost:9001/accounts/root')
+    expect(object.id).to.equal('http://localhost:' + servers[0].port + '/accounts/root')
     expect(object.name).to.equal('root')
     expect(object.preferredUsername).to.equal('root')
   })
@@ -51,17 +50,17 @@ describe('Test activitypub', function () {
     const object = res.body
 
     expect(object.type).to.equal('Video')
-    expect(object.id).to.equal('http://localhost:9001/videos/watch/' + videoUUID)
+    expect(object.id).to.equal('http://localhost:' + servers[0].port + '/videos/watch/' + videoUUID)
     expect(object.name).to.equal('video')
   })
 
   it('Should redirect to the origin video object', async function () {
     const res = await makeActivityPubGetRequest(servers[1].url, '/videos/watch/' + videoUUID, 302)
 
-    expect(res.header.location).to.equal('http://localhost:9001/videos/watch/' + videoUUID)
+    expect(res.header.location).to.equal('http://localhost:' + servers[0].port + '/videos/watch/' + videoUUID)
   })
 
   after(async function () {
-    killallServers(servers)
+    await cleanupTests(servers)
   })
 })