Files
archrepo/test/app.e2e-spec.ts
Yi-Ting Shih 3dd0137562
All checks were successful
Build and push image / release-image (push) Successful in 1m40s
Fix: e2e test
2025-07-10 18:20:04 +08:00

28 lines
768 B
TypeScript

import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import * as request from 'supertest';
import { App } from 'supertest/types';
import { AppModule } from './../src/app.module';
describe('AppController (e2e)', () => {
let app: INestApplication<App>;
beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [ConfigModule.forRoot()],
providers: [AppModule],
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
});
it('/healthz (GET)', () => {
return request(app.getHttpServer())
.get('/healthz')
.expect(200)
.expect('OK');
});
});