fix: use real 500 error page in dev mode (#2134)

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
This commit is contained in:
Christian Svensson
2023-12-04 12:06:06 +01:00
committed by GitHub
co-authored by Marvin Hagemeister
parent e78c6a90af
commit c4e09d1cef
7 changed files with 19 additions and 27 deletions
+4 -6
View File
@@ -2,7 +2,6 @@ import { assert, assertEquals, assertStringIncludes } from "./deps.ts";
import { STATUS_CODE } from "../server.ts";
import {
assertNotSelector,
assertSelector,
assertTextMany,
assertTextMatch,
fetchHtml,
@@ -118,17 +117,16 @@ Deno.test("show codeframe in dev mode even with custom 500", async () => {
await withFakeServe(
"./tests/fixture_dev_codeframe/dev.ts",
async (server) => {
const doc = await server.getHtml(`/`);
assertSelector(doc, ".frsh-error-page");
const { title } = await getErrorOverlay(server, "/");
assertEquals(title, "fail");
},
);
await withFakeServe(
"./tests/fixture_dev_codeframe/main.ts",
async (server) => {
const doc = await server.getHtml(`/`);
assertNotSelector(doc, ".frsh-error-page");
assertSelector(doc, "h1");
const doc = await server.getHtml("/");
assertNotSelector(doc, "#fresh-error-overlay");
},
);
});