Files
edr-platform/apps/edr-freight-api/test/app.e2e-spec.ts
2026-05-12 15:17:16 +03:00

27 lines
680 B
TypeScript

import { INestApplication } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import request from 'supertest';
import { AppModule } from '../src/app.module';
describe('Freight API (e2e)', () => {
let app: INestApplication;
beforeAll(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
});
afterAll(async () => {
await app.close();
});
it('GET /api/bookings returns a 200 with a list', () => {
return request(app.getHttpServer()).get('/api/bookings').expect(200);
});
});