svr-imp/test/app.e2e-spec.ts

30 lines
698 B
TypeScript
Raw Normal View History

2025-01-17 14:11:29 +00:00
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
2025-01-17 14:11:29 +00:00
import * as request from 'supertest';
import { App } from 'supertest/types';
import { AppModule } from './../src/app.module';
describe('AppController (e2e)', () => {
2025-01-17 14:11:29 +00:00
let app: INestApplication<App>;
beforeAll(async () => {
const moduleFixture = await Test.createTestingModule({
imports: [AppModule],
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
});
2023-02-19 15:35:42 +00:00
afterAll(async () => {
await app.close();
});
2018-04-28 16:04:45 +00:00
it('/ (GET)', () => {
return request(app.getHttpServer())
.get('/')
.expect(200)
.expect('Hello World!');
});
});