Files
trackgo-be/test/app.e2e-spec.ts
T
shancheas 289ab1006e Initialize NestJS project with essential configuration files and structure
- Added .env.example for application timezone configuration.
- Created .gitignore to exclude unnecessary files and directories.
- Introduced Prettier configuration in .prettierrc for code formatting.
- Set up ESLint configuration in eslint.config.mjs for code quality checks.
- Added nest-cli.json for NestJS project settings.
- Created package.json with project dependencies and scripts for building, testing, and running the application.
- Generated pnpm-lock.yaml for package management.
- Added README.md with project description and setup instructions.
- Created initial application structure with AppModule, AppController, and AppService.
- Implemented basic unit and e2e tests for the application.
2026-08-20 18:31:33 +07:00

30 lines
725 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!');
});
afterEach(async () => {
await app.close();
});
});