/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
+import { SQLCommand } from '@server/tests/shared'
import {
cleanupTests,
createMultipleServers,
waitJobs
} from '@shared/server-commands'
-const expect = chai.expect
-
describe('Test ActivityPub fetcher', function () {
let servers: PeerTubeServer[]
+ let sqlCommandServer1: SQLCommand
// ---------------------------------------------------------------
const { uuid } = await servers[0].videos.upload({ attributes: { name: 'bad video root' } })
await servers[0].videos.upload({ token: userAccessToken, attributes: { name: 'video user' } })
+ sqlCommandServer1 = new SQLCommand(servers[0])
+
{
- const to = 'http://localhost:' + servers[0].port + '/accounts/user1'
- const value = 'http://localhost:' + servers[1].port + '/accounts/user1'
- await servers[0].sql.setActorField(to, 'url', value)
+ const to = servers[0].url + '/accounts/user1'
+ const value = servers[1].url + '/accounts/user1'
+ await sqlCommandServer1.setActorField(to, 'url', value)
}
{
- const value = 'http://localhost:' + servers[2].port + '/videos/watch/' + uuid
- await servers[0].sql.setVideoField(uuid, 'url', value)
+ const value = servers[2].url + '/videos/watch/' + uuid
+ await sqlCommandServer1.setVideoField(uuid, 'url', value)
}
})
after(async function () {
this.timeout(20000)
+ await sqlCommandServer1.cleanup()
await cleanupTests(servers)
})
})