1 /* tslint:disable:no-unused-expression */
3 import * as chai from 'chai'
5 import { flushTests, killallServers, makeActivityPubGetRequest, runServer, ServerInfo, setAccessTokensToServers } from './utils'
7 const expect = chai.expect
9 describe('Test activitypub', function () {
10 let server: ServerInfo = null
12 before(async function () {
17 server = await runServer(1)
19 await setAccessTokensToServers([ server ])
22 it('Should return the account object', async function () {
23 const res = await makeActivityPubGetRequest(server.url, '/accounts/root')
24 const object = res.body
26 expect(object.type).to.equal('Person')
27 expect(object.id).to.equal('http://localhost:9001/accounts/root')
28 expect(object.name).to.equal('root')
29 expect(object.preferredUsername).to.equal('root')
32 after(async function () {
33 killallServers([ server ])
35 // Keep the logs if the test failed