1
0
Fork 0
peertube/shared/extra-utils/server/clients.ts

20 lines
457 B
TypeScript
Raw Normal View History

2017-09-04 15:21:47 -04:00
import * as request from 'supertest'
2018-02-16 05:04:12 -05:00
import * as urlUtil from 'url'
2017-09-04 15:21:47 -04:00
function getClient (url: string) {
2017-09-07 11:58:09 -04:00
const path = '/api/v1/oauth-clients/local'
2017-09-04 15:21:47 -04:00
return request(url)
.get(path)
2018-02-16 05:04:12 -05:00
.set('Host', urlUtil.parse(url).host)
2017-09-04 15:21:47 -04:00
.set('Accept', 'application/json')
.expect(200)
.expect('Content-Type', /json/)
}
// ---------------------------------------------------------------------------
export {
getClient
}