-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: the route 'api/health' only return a status code
- Loading branch information
Showing
2 changed files
with
12 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { HealthController } from './health.controller'; | ||
import { HttpStatus } from '@nestjs/common'; | ||
|
||
describe('HealthController', () => { | ||
let healthController: HealthController; | ||
|
||
beforeEach(() => { | ||
healthController = new HealthController(); | ||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [HealthController], | ||
}).compile(); | ||
|
||
healthController = module.get<HealthController>(HealthController); | ||
}); | ||
|
||
describe('checkHealth', () => { | ||
it('should return status 200 with a healthy message', async () => { | ||
it('should return status 200', async () => { | ||
const result = await healthController.checkHealth(); | ||
|
||
expect(result).toEqual({ | ||
status: HttpStatus.OK, | ||
message: 'Server is healthy', | ||
}); | ||
expect(result).toEqual(undefined); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters