2017-09-04 15:21:47 -04:00
|
|
|
import * as request from 'supertest'
|
2020-01-31 10:56:52 -05:00
|
|
|
import { URL } 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)
|
2020-01-31 10:56:52 -05:00
|
|
|
.set('Host', new URL(url).host)
|
2017-09-04 15:21:47 -04:00
|
|
|
.set('Accept', 'application/json')
|
|
|
|
.expect(200)
|
|
|
|
.expect('Content-Type', /json/)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
|
|
|
getClient
|
|
|
|
}
|