-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import * as chai from 'chai'
import 'mocha'
import {
+ cleanupTests,
doubleFollow,
flushAndRunMultipleServers,
- flushTests,
- killallServers,
makeActivityPubGetRequest,
ServerInfo,
setAccessTokensToServers,
uploadVideo
} from '../../../../shared/extra-utils'
+import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
const expect = chai.expect
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')
})
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)
+ const res = await makeActivityPubGetRequest(servers[1].url, '/videos/watch/' + videoUUID, HttpStatusCode.FOUND_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(function () {
- killallServers(servers)
+ after(async function () {
+ await cleanupTests(servers)
})
})