PeerTube/server/tests/api/server/no-client.ts

27 lines
753 B
TypeScript
Raw Normal View History

2018-11-14 08:27:47 -06:00
import 'mocha'
import * as request from 'supertest'
2019-04-24 08:10:37 -05:00
import { ServerInfo } from '../../../../shared/extra-utils'
import { cleanupTests, flushAndRunServer } from '../../../../shared/extra-utils/server/servers'
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
2018-11-14 08:27:47 -06:00
describe('Start and stop server without web client routes', function () {
let server: ServerInfo
before(async function () {
this.timeout(30000)
2020-01-31 09:56:52 -06:00
server = await flushAndRunServer(1, {}, [ '--no-client' ])
2018-11-14 08:27:47 -06:00
})
it('Should fail getting the client', function () {
const req = request(server.url)
.get('/')
return req.expect(HttpStatusCode.NOT_FOUND_404)
2018-11-14 08:27:47 -06:00
})
2019-04-24 08:10:37 -05:00
after(async function () {
await cleanupTests([ server ])
2018-11-14 08:27:47 -06:00
})
})