aboutsummaryrefslogtreecommitdiff
path: root/src/routes.test.ts
diff options
context:
space:
mode:
authorKevin J Hoerr <kjhoerr@protonmail.com>2020-04-27 05:23:23 -0400
committerKevin J Hoerr <kjhoerr@protonmail.com>2020-04-27 05:23:23 -0400
commit32db5f6e5e8b6f6d2baffbec44cc34daedd24533 (patch)
tree9c2687baec92e70a28690165729ff871c2d147c3 /src/routes.test.ts
parent051ff1871a163c62f1c5f5aa5ffb0ac18da49424 (diff)
downloadao-coverage-32db5f6e5e8b6f6d2baffbec44cc34daedd24533.tar.gz
ao-coverage-32db5f6e5e8b6f6d2baffbec44cc34daedd24533.tar.bz2
ao-coverage-32db5f6e5e8b6f6d2baffbec44cc34daedd24533.zip
Add unit tests and correct CHANGELOG
Diffstat (limited to 'src/routes.test.ts')
-rw-r--r--src/routes.test.ts11
1 files changed, 11 insertions, 0 deletions
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", () => {