18 lines
505 B
TypeScript
18 lines
505 B
TypeScript
import request from 'supertest';
|
|
import { DvbookingApiContext } from './dvbooking.api-context';
|
|
|
|
export class DvBookingHttpClient {
|
|
constructor(private context: DvbookingApiContext) {}
|
|
|
|
private createRequest() {
|
|
return request(this.context.app.getHttpServer());
|
|
}
|
|
public async httpPost(path: string, data?: string | object) {
|
|
return await this.createRequest().post(path).send(data);
|
|
}
|
|
|
|
public async httpGet(path: string) {
|
|
return await this.createRequest().get(path).send();
|
|
}
|
|
}
|