clients.ts 547 B

1234567891011121314151617181920
  1. import * as request from 'supertest'
  2. import { URL } from 'url'
  3. import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
  4. function getClient (url: string) {
  5. const path = '/api/v1/oauth-clients/local'
  6. return request(url)
  7. .get(path)
  8. .set('Host', new URL(url).host)
  9. .set('Accept', 'application/json')
  10. .expect(HttpStatusCode.OK_200)
  11. .expect('Content-Type', /json/)
  12. }
  13. // ---------------------------------------------------------------------------
  14. export {
  15. getClient
  16. }