diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-11-14 15:27:47 +0100 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2018-11-14 15:59:56 +0100 |
commit | b83b8dd5aef03084133c5983de6f312e7d1654b8 (patch) | |
tree | 4daf0f5f10dac8b1c5704d9823b734aa1051d99a /server/tests/api | |
parent | fb651cf2d426e7429a7c571ab7d93becd63ad116 (diff) | |
download | PeerTube-b83b8dd5aef03084133c5983de6f312e7d1654b8.tar.gz PeerTube-b83b8dd5aef03084133c5983de6f312e7d1654b8.tar.zst PeerTube-b83b8dd5aef03084133c5983de6f312e7d1654b8.zip |
add cli option to run without client
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/server/index.ts | 1 | ||||
-rw-r--r-- | server/tests/api/server/no-client.ts | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/server/tests/api/server/index.ts b/server/tests/api/server/index.ts index eeb8b7a28..78ab7e18b 100644 --- a/server/tests/api/server/index.ts +++ b/server/tests/api/server/index.ts | |||
@@ -6,3 +6,4 @@ import './jobs' | |||
6 | import './reverse-proxy' | 6 | import './reverse-proxy' |
7 | import './stats' | 7 | import './stats' |
8 | import './tracker' | 8 | import './tracker' |
9 | import './no-client' | ||
diff --git a/server/tests/api/server/no-client.ts b/server/tests/api/server/no-client.ts new file mode 100644 index 000000000..6d6ce8532 --- /dev/null +++ b/server/tests/api/server/no-client.ts | |||
@@ -0,0 +1,36 @@ | |||
1 | import 'mocha' | ||
2 | import * as request from 'supertest' | ||
3 | import { | ||
4 | flushTests, | ||
5 | killallServers, | ||
6 | ServerInfo | ||
7 | } from '../../utils/index' | ||
8 | import { runServer } from '../../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 | }) | ||