dvbooking/test/client/dvbooking.http-client.ts
Roland Schneider c169faf288 add e2e
2025-10-30 21:02:05 +01:00

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();
}
}