think/packages/server/test/app.e2e-spec.ts

22 lines
609 B
TypeScript
Raw Normal View History

2022-02-20 19:51:55 +08:00
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 moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
});
it('/ (GET)', () => {
2022-03-12 11:27:56 +08:00
return request(app.getHttpServer()).get('/').expect(200).expect('Hello World!');
2022-02-20 19:51:55 +08:00
});
});