aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/tests/utils/request-schedulers.js
blob: 16835ce47033ec5097c11684cab9944aba978fec (plain) (tree)
























                                                                              
'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