diff options
Diffstat (limited to 'server/tests/utils/request-schedulers.ts')
-rw-r--r-- | server/tests/utils/request-schedulers.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/tests/utils/request-schedulers.ts b/server/tests/utils/request-schedulers.ts new file mode 100644 index 000000000..ae8227b79 --- /dev/null +++ b/server/tests/utils/request-schedulers.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | import * as request from 'supertest' | ||
2 | |||
3 | function getRequestsStats (server: { url: string }, accessToken: string) { | ||
4 | const path = '/api/v1/requests/stats' | ||
5 | |||
6 | return request(server.url) | ||
7 | .get(path) | ||
8 | .set('Accept', 'application/json') | ||
9 | .set('Authorization', 'Bearer ' + accessToken) | ||
10 | .expect(200) | ||
11 | .expect('Content-Type', /json/) | ||
12 | } | ||
13 | |||
14 | // --------------------------------------------------------------------------- | ||
15 | |||
16 | export { | ||
17 | getRequestsStats | ||
18 | } | ||