From 9639bd175726b73f8fe664b5ced12a72407b1f0b Mon Sep 17 00:00:00 2001 From: buoyantair Date: Mon, 29 Oct 2018 22:18:31 +0530 Subject: Move utils to /shared Move utils used by /server/tools/* & /server/tests/**/* into /shared folder. Issue: #1336 --- shared/utils/server/clients.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 shared/utils/server/clients.ts (limited to 'shared/utils/server/clients.ts') diff --git a/shared/utils/server/clients.ts b/shared/utils/server/clients.ts new file mode 100644 index 000000000..273aac747 --- /dev/null +++ b/shared/utils/server/clients.ts @@ -0,0 +1,19 @@ +import * as request from 'supertest' +import * as urlUtil from 'url' + +function getClient (url: string) { + const path = '/api/v1/oauth-clients/local' + + return request(url) + .get(path) + .set('Host', urlUtil.parse(url).host) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) +} + +// --------------------------------------------------------------------------- + +export { + getClient +} -- cgit v1.2.3