Initial curated CertScope source from fe2bbe3ca5c98bf64be26a09c6c58ee805a7f87e
This commit is contained in:
commit
7348faf6c0
65 files changed
+12509
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { statusForHttp } from "./http-status";
|
||||
|
||||
describe("HTTP status semantics", () => {
|
||||
it.each([
|
||||
[100, "Informational response", "muted"],
|
||||
[200, "Healthy response", "green"],
|
||||
[302, "Redirect response", "muted"],
|
||||
[404, "Client error", "amber"],
|
||||
[503, "Server error", "red"],
|
||||
] as const)("classifies %s without misleading status colors", (status, label, tone) => {
|
||||
expect(statusForHttp(status)).toEqual({ label, tone });
|
||||
});
|
||||
|
||||
it.each([null, undefined, 99, 600, 200.5, "200"])("treats %s as incomplete", (status) => {
|
||||
expect(statusForHttp(status).label).toBe("Incomplete");
|
||||
expect(statusForHttp(status).tone).toBe("muted");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user