Initial commit Changes to be committed: new file: .gitignore new file: .prettierrc new file: LICENSE new file: README.md new file: eslint.config.mjs new file: nest-cli.json new file: package.json new file: pnpm-lock.yaml new file: src/app.controller.spec.ts new file: src/app.controller.ts new file: src/app.module.ts new file: src/app.service.ts new file: src/main.ts new file: test/app.e2e-spec.ts new file: test/jest-e2e.json new file: tsconfig.build.json new file: tsconfig.json
26 lines
669 B
TypeScript
26 lines
669 B
TypeScript
import { Test, TestingModule } from '@nestjs/testing';
|
|
import { INestApplication } from '@nestjs/common';
|
|
import 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: [AppModule],
|
|
}).compile();
|
|
|
|
app = moduleFixture.createNestApplication();
|
|
await app.init();
|
|
});
|
|
|
|
it('/ (GET)', () => {
|
|
return request(app.getHttpServer())
|
|
.get('/')
|
|
.expect(200)
|
|
.expect('Hello World!');
|
|
});
|
|
});
|