File tree Expand file tree Collapse file tree 5 files changed +26
-2
lines changed
test/integration/healthcheck Expand file tree Collapse file tree 5 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 11import { HealthStatus } from '@domain/health/health-status' ;
2+ import { AppInfo } from '@presentation/config/app.config' ;
23
34class HealthStatusResponse {
45 readonly status : string ;
56
67 readonly message : string ;
78
9+ readonly appVersion = AppInfo . APP_VERSION ;
10+
811 constructor ( status : string , message : string ) {
912 this . status = status ;
1013 this . message = message ;
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ class App {
122122 Version: ${ AppInfo . APP_VERSION }
123123 Port: ${ this . port }
124124 Base Path: ${ this . basePath }
125+ OpenApi Spec Path: ${ this . basePath } /spec
125126 Environment: ${ this . env }
126127 Author: ${ AppInfo . AUTHOR_NAME }
127128 Email: ${ AppInfo . AUTHOR_EMAIL }
Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ components:
3636 type : string
3737 description : Description of server status
3838 example : ' 🚀 To infinity and beyond!'
39+ timestamp :
40+ type : string
41+ description : Timestamp of server status
42+ example : ' 2020-01-01T00:00:00Z'
43+ appVersion :
44+ type : string
45+ description : Application version
46+ example : ' 1.0.0'
3947 ErrorResponse :
4048 type : object
4149 properties :
@@ -51,3 +59,11 @@ components:
5159 type : string
5260 description : Error description
5361 example : ' Unexpected internal server error'
62+ timestamp :
63+ type : string
64+ description : Timestamp of server status
65+ example : ' 2020-01-01T00:00:00Z'
66+ appVersion :
67+ type : string
68+ description : Application version
69+ example : ' 1.0.0'
Original file line number Diff line number Diff line change 1+ import { AppInfo } from '@presentation/config/app.config' ;
2+
13class ErrorResponse {
24 public status : number ;
35
46 public code : string ;
57
68 public message : string ;
79
10+ readonly appVersion = AppInfo . APP_VERSION ;
11+
812 constructor ( status : number , code : string , message : string ) {
913 this . status = status ;
1014 this . code = code ;
Original file line number Diff line number Diff line change 11import { HealthCheckerUseCase } from '@application/health/health-checker.usecase' ;
2- import { HealthStatus } from '@domain /health/health-status' ;
2+ import { HealthStatusResponse } from '@application /health/health-status.response ' ;
33
44describe ( 'Testing health check use case' , ( ) => {
55 it ( 'should return ALIVE health status' , ( ) => {
66 const healthCheckerUseCase = new HealthCheckerUseCase ( ) ;
77 return expect ( healthCheckerUseCase . execute ( ) ) . resolves . toEqual (
8- new HealthStatus ( 'ALIVE' , '🚀 To infinity and beyond!' )
8+ new HealthStatusResponse ( 'ALIVE' , '🚀 To infinity and beyond!' )
99 ) ;
1010 } ) ;
1111} ) ;
You can’t perform that action at this time.
0 commit comments