generated from companieshouse/node-review-web-starter-ts
-
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 h2 tag mismatch in start.njk - revert govuk-frontent to 4.8.0
- Loading branch information
Showing
9 changed files
with
62 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { HttpStatusCode } from "axios"; | ||
import { Request, Response, Router } from "express"; | ||
import { logger } from "../lib/logger"; | ||
|
||
const healthCheckRouter: Router = Router(); | ||
|
||
healthCheckRouter.get("/", (req: Request, res: Response) => { | ||
logger.debugRequest(req, `GET healthcheck`); | ||
|
||
res.status(HttpStatusCode.Ok).send("OK"); | ||
}); | ||
|
||
export default healthCheckRouter; |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import middlewareMocks from "../mocks/allMiddleware.mock"; | ||
import request from "supertest"; | ||
import app from "../../src/app"; | ||
import { PrefixedUrls } from "../../src/constants"; | ||
import { HttpStatusCode } from "axios"; | ||
|
||
jest.mock("ioredis"); | ||
|
||
describe("Healthcheck integration tests", () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
afterEach(() => { | ||
expect(middlewareMocks.mockSessionMiddleware).toHaveBeenCalledTimes(1); | ||
}); | ||
|
||
describe("GET method", () => { | ||
|
||
it("should return status 200 and content 'OK'", async () => { | ||
const resp = await request(app).get(PrefixedUrls.HEALTHCHECK); | ||
|
||
expect(resp.status).toBe(HttpStatusCode.Ok); | ||
expect(resp.text).toBe("OK"); | ||
}); | ||
|
||
}); | ||
}); |