PeerTube/server/tests/utils/request-schedulers.js

26 lines
587 B
JavaScript
Raw Normal View History

2017-03-19 03:16:33 -05:00
'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