refactor: use named status codes from std internally (#417)
Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit is contained in:
co-authored by
Luca Casonato
parent
ba20756c17
commit
1dc1f87fc3
+3
-3
@@ -1,4 +1,4 @@
|
||||
import { ServerContext } from "../server.ts";
|
||||
import { ServerContext, Status } from "../server.ts";
|
||||
import { REFRESH_JS_URL } from "../src/server/constants.ts";
|
||||
import { assert, assertEquals, assertStringIncludes } from "./deps.ts";
|
||||
import manifest from "./fixture_error/fresh.gen.ts";
|
||||
@@ -22,7 +22,7 @@ const router = (req: Request) => {
|
||||
Deno.test("error page rendered", async () => {
|
||||
const resp = await router(new Request("https://fresh.deno.dev/"));
|
||||
assert(resp);
|
||||
assertEquals(resp.status, 500);
|
||||
assertEquals(resp.status, Status.InternalServerError);
|
||||
assertEquals(resp.headers.get("content-type"), "text/html; charset=utf-8");
|
||||
const body = await resp.text();
|
||||
assertStringIncludes(
|
||||
@@ -37,7 +37,7 @@ Deno.test("refresh.js rendered", async () => {
|
||||
new Request("https://fresh.deno.dev" + REFRESH_JS_URL),
|
||||
);
|
||||
assert(resp);
|
||||
assertEquals(resp.status, 200);
|
||||
assertEquals(resp.status, Status.OK);
|
||||
assertEquals(
|
||||
resp.headers.get("content-type"),
|
||||
"application/javascript; charset=utf-8",
|
||||
|
||||
Reference in New Issue
Block a user