aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-03-19 09:16:33 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-03-19 09:16:33 +0100
commitf148e5edb62c914eff12d7d4a5f879fedcfc64be (patch)
tree2846728352e1c21ed06e7a7b85396eb542108bba /server/tests/utils
parent55b3394641a764b89132d0057d3fdf656dab2389 (diff)
downloadPeerTube-f148e5edb62c914eff12d7d4a5f879fedcfc64be.tar.gz
PeerTube-f148e5edb62c914eff12d7d4a5f879fedcfc64be.tar.zst
PeerTube-f148e5edb62c914eff12d7d4a5f879fedcfc64be.zip
Better real world test
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/requests-stats.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/server/tests/utils/requests-stats.js b/server/tests/utils/requests-stats.js
new file mode 100644
index 000000000..16835ce47
--- /dev/null
+++ b/server/tests/utils/requests-stats.js
@@ -0,0 +1,25 @@
1'use strict'
2
3const request = require('supertest')
4
5const requestsStatsUtils = {
6 getRequestsStats
7}
8
9// ---------------------- Export functions --------------------
10
11function getRequestsStats (server, accessToken, callback) {
12 const path = '/api/v1/requests/stats'
13
14 request(server.url)
15 .get(path)
16 .set('Accept', 'application/json')
17 .set('Authorization', 'Bearer ' + accessToken)
18 .expect(200)
19 .expect('Content-Type', /json/)
20 .end(callback)
21}
22
23// ---------------------------------------------------------------------------
24
25module.exports = requestsStatsUtils