Update tests

This commit is contained in:
Alex Holliday committed 2024-10-24 11:37:24 +08:00
1 parent 1fc2bd49c8
commit 084315c377
2 files changed
+23 -27

No files matched your search

@@ -148,4 +148,11 @@ describe("controllerUtils - fetchMonitorCertificate", () => {
const result = await fetchMonitorCertificate(sslChecker, monitor);
expect(result).to.deep.equal({ validTo: "2022-01-01" });
});
it("should throw an error if a ssl-checker returns null", async () => {
sslChecker.returns(null);
await fetchMonitorCertificate(sslChecker, monitor).catch((error) => {
expect(error).to.be.an("error");
expect(error.message).to.equal("Certificate not found");
});
});
});