]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/api/server/no-client.ts
Merge branch 'develop' of https://github.com/Chocobozzz/PeerTube into move-utils...
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / no-client.ts
1 import 'mocha'
2 import * as request from 'supertest'
3 import {
4 flushTests,
5 killallServers,
6 ServerInfo
7 } from '../../../../shared/utils'
8 import { runServer } from '../../../../shared/utils/server/servers'
9
10 describe('Start and stop server without web client routes', function () {
11 let server: ServerInfo
12
13 before(async function () {
14 this.timeout(30000)
15
16 await flushTests()
17
18 server = await runServer(1, {}, ['--no-client'])
19 })
20
21 it('Should fail getting the client', function () {
22 const req = request(server.url)
23 .get('/')
24
25 return req.expect(404)
26 })
27
28 after(async function () {
29 killallServers([ server ])
30
31 // Keep the logs if the test failed
32 if (this['ok']) {
33 await flushTests()
34 }
35 })
36 })