Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
fix: e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
aaitor committed Jun 20, 2024
1 parent 8385b72 commit e838530
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/modules/info/info.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Module } from '@nestjs/common'
import { InfoController } from './info.controller'
import { InfoService } from './info.service'
import { ConfigService } from '@nestjs/config'

@Module({
imports: [],
controllers: [InfoController],
providers: [InfoService]
providers: [InfoService, ConfigService]
})
export class InfoModule {}
12 changes: 5 additions & 7 deletions test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import { Test, TestingModule } from '@nestjs/testing'
import { INestApplication } from '@nestjs/common'
import { ConfigModule } from '@nestjs/config'
import * as request from 'supertest'
import { AppModule } from '../src/modules/info/info.module'
import { InfoModule } from '../src/modules/info/info.module'

describe('AppController (e2e)', () => {
describe('InfoController (e2e)', () => {
let app: INestApplication

beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule]
imports: [ConfigModule, InfoModule]
}).compile()

app = moduleFixture.createNestApplication()
await app.init()
})

it('/ (GET)', () => {
return request(app.getHttpServer())
.get('/')
.expect(200)
.expect('Hello World!')
return request(app.getHttpServer()).get('/').expect(200)
})
})

0 comments on commit e838530

Please sign in to comment.