seedling/source/api/test/app.e2e-spec.ts
Roman Jaroš 6ea4c9022d Replace HapiJs with NestJs as API framework
Change-Id: I54dc6c5f6377358e4f6614378fbb253b0c7841a9
2023-09-14 20:18:20 +02:00

26 lines
667 B
TypeScript

// @ts-nocheck
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { AppModule } from '../src/app.module';
describe('AppController (e2e)', () => {
let app: INestApplication;
beforeEach(async () => {
const moduleRef: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();
app = moduleRef.createNestApplication();
await app.init();
});
it('/health-check (GET)', () => {
return request.agent(app.getHttpServer()).get('/health-check').expect(200).expect('OK');
});
afterAll(async () => {
await app.close();
});
});