Skip to content

Commit

Permalink
[#7] fix: remove testcontainers from app tests
Browse files Browse the repository at this point in the history
  • Loading branch information
glemenneo committed Sep 18, 2024
1 parent 7942e03 commit f568045
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions backend/user-service/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
import { MongoDBContainer, StartedMongoDBContainer } from '@testcontainers/mongodb'
import request from 'supertest'
import logger from '../src/common/logger.util'
import app from '../src/index'

describe('Index', () => {
let startedContainer: StartedMongoDBContainer

beforeAll(async () => {
const container: MongoDBContainer = new MongoDBContainer().withExposedPorts(27017)
startedContainer = await container.start()
logger.info(
`[Index Test] MongoDB container started on ${startedContainer.getHost()}:${startedContainer.getMappedPort(27017)}`
)
process.env.DB_URL = `mongodb://${startedContainer.getHost()}:${startedContainer.getMappedPort(27017)}/user-service`
})

afterAll(async () => {
await startedContainer.stop()
logger.info(`[Index Test] MongoDB container stopped`)
})

describe('GET /', () => {
it('should return 200 OK', async () => {
const response = await request(app).get('/')
Expand Down

0 comments on commit f568045

Please sign in to comment.