diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-07 22:09:59 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-07 22:09:59 +0200 |
commit | 8d30905858245f12a42fc327d2d57cbfe062d548 (patch) | |
tree | 9bd590872fbb753782f2ebbb9516db0414022d70 /server/tests/utils/clients.js | |
parent | 58b2ba55a90f05f24661e664b1fb0a3486f037e8 (diff) | |
download | PeerTube-8d30905858245f12a42fc327d2d57cbfe062d548.tar.gz PeerTube-8d30905858245f12a42fc327d2d57cbfe062d548.tar.zst PeerTube-8d30905858245f12a42fc327d2d57cbfe062d548.zip |
Server: split tests utils in multiple files
Diffstat (limited to 'server/tests/utils/clients.js')
-rw-r--r-- | server/tests/utils/clients.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/server/tests/utils/clients.js b/server/tests/utils/clients.js new file mode 100644 index 000000000..e3ded493e --- /dev/null +++ b/server/tests/utils/clients.js | |||
@@ -0,0 +1,24 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | const request = require('supertest') | ||
4 | |||
5 | const clientsUtils = { | ||
6 | getClient: getClient | ||
7 | } | ||
8 | |||
9 | // ---------------------- Export functions -------------------- | ||
10 | |||
11 | function getClient (url, end) { | ||
12 | const path = '/api/v1/users/client' | ||
13 | |||
14 | request(url) | ||
15 | .get(path) | ||
16 | .set('Accept', 'application/json') | ||
17 | .expect(200) | ||
18 | .expect('Content-Type', /json/) | ||
19 | .end(end) | ||
20 | } | ||
21 | |||
22 | // --------------------------------------------------------------------------- | ||
23 | |||
24 | module.exports = clientsUtils | ||