mirror of
https://github.com/andwati/blog-nest.git
synced 2026-10-22 23:32:15 +00:00
- Added pnpm-workspace.yaml to manage workspace packages and dependencies. - Created tsconfig.json with strict TypeScript settings for better type safety. - Introduced turbo.json to define build, lint, test, and other tasks with dependencies.
26 lines
671 B
TypeScript
26 lines
671 B
TypeScript
import type { INestApplication } from '@nestjs/common'
|
|
import { Test, type TestingModule } from '@nestjs/testing'
|
|
import request from 'supertest'
|
|
import type { 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!')
|
|
})
|
|
})
|