From 32db5f6e5e8b6f6d2baffbec44cc34daedd24533 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Mon, 27 Apr 2020 05:23:23 -0400 Subject: Add unit tests and correct CHANGELOG --- src/routes.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/routes.test.ts') diff --git a/src/routes.test.ts b/src/routes.test.ts index 3579011..90084f6 100644 --- a/src/routes.test.ts +++ b/src/routes.test.ts @@ -117,6 +117,17 @@ describe("Static files", () => { .expect(200); expect(res.text).toEqual(buffer.toString("utf-8")); }); + + it("should return 404.html at unhandled endpoints", async () => { + const buffer = await fs.promises.readFile( + path.join(staticRoot, "404.html") + ); + + const res = await request() + .get("/thisisnotanendpoint") + .expect(404); + expect(res.text).toEqual(buffer.toString("utf-8")); + }); }); describe("Badges and reports", () => { -- cgit