import 'mocha'
import * as chai from 'chai'
-import {
- cleanupTests,
- createMultipleServers,
- MockInstancesIndex,
- PeerTubeServer,
- setAccessTokensToServers,
- wait,
- waitJobs
-} from '@shared/extra-utils'
+import { MockInstancesIndex } from '@server/tests/shared'
+import { wait } from '@shared/core-utils'
+import { cleanupTests, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
const expect = chai.expect
const body = await following.follows.getFollowers({ start: 0, count: 5, sort: '-createdAt' })
const follow = body.data.find(f => f.follower.host === follower.host && f.state === 'accepted')
- if (exists === true) expect(follow).to.exist
- else expect(follow).to.be.undefined
+ if (exists === true) expect(follow, `Follower ${follower.url} should exist on ${following.url}`).to.exist
+ else expect(follow, `Follower ${follower.url} should not exist on ${following.url}`).to.be.undefined
}
{
const body = await follower.follows.getFollowings({ start: 0, count: 5, sort: '-createdAt' })
const follow = body.data.find(f => f.following.host === following.host && f.state === 'accepted')
- if (exists === true) expect(follow).to.exist
- else expect(follow).to.be.undefined
+ if (exists === true) expect(follow, `Following ${following.url} should exist on ${follower.url}`).to.exist
+ else expect(follow, `Following ${following.url} should not exist on ${follower.url}`).to.be.undefined
}
}
await checkFollow(servers[0], servers[1], false)
await checkFollow(servers[0], servers[2], true)
})
+
+ after(async function () {
+ await instanceIndexServer.terminate()
+ })
})
after(async function () {