aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/request-schedulers.js
blob: 16835ce47033ec5097c11684cab9944aba978fec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict'

const request = require('supertest')

const requestsStatsUtils = {
  getRequestsStats
}

// ---------------------- Export functions --------------------

function getRequestsStats (server, accessToken, callback) {
  const path = '/api/v1/requests/stats'

  request(server.url)
    .get(path)
    .set('Accept', 'application/json')
    .set('Authorization', 'Bearer ' + accessToken)
    .expect(200)
    .expect('Content-Type', /json/)
    .end(callback)
}

// ---------------------------------------------------------------------------

module.exports = requestsStatsUtils