import 'mocha'
import { User, Video } from '../../../../shared/index'
import {
+ cleanupTests,
createUser,
doubleFollow,
flushAndRunMultipleServers,
updateVideoChannelAvatar,
uploadVideo,
userLogin
-} from '../../../../shared/utils'
+} from '../../../../shared/extra-utils'
import {
addVideoChannel,
deleteVideoChannel,
ServerInfo,
setAccessTokensToServers,
updateVideoChannel
-} from '../../../../shared/utils/index'
-import { waitJobs } from '../../../../shared/utils/server/jobs'
+} from '../../../../shared/extra-utils/index'
+import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
const expect = chai.expect
before(async function () {
this.timeout(30000)
- await flushTests()
-
servers = await flushAndRunMultipleServers(2)
await setAccessTokensToServers(servers)
this.timeout(10000)
for (const server of servers) {
- const channelURI = 'second_video_channel@localhost:9001'
+ const channelURI = 'second_video_channel@localhost:' + server.port
const res1 = await getVideoChannelVideos(server.url, server.accessToken, channelURI, 0, 5)
expect(res1.body.total).to.equal(1)
expect(res1.body.data).to.be.an('array')
this.timeout(10000)
for (const server of servers) {
- const secondChannelURI = 'second_video_channel@localhost:9001'
+ const secondChannelURI = 'second_video_channel@localhost:' + server.port
const res1 = await getVideoChannelVideos(server.url, server.accessToken, secondChannelURI, 0, 5)
expect(res1.body.total).to.equal(0)
- const channelURI = 'root_channel@localhost:9001'
+ const channelURI = 'root_channel@localhost:' + server.port
const res2 = await getVideoChannelVideos(server.url, server.accessToken, channelURI, 0, 5)
expect(res2.body.total).to.equal(1)
})
after(async function () {
- killallServers(servers)
+ await cleanupTests(servers)
})
})