feat: middleware can call renderNotFound (#1975)

This commit is contained in:
Reed von Redwitz
2023-10-27 23:34:49 +02:00
committed by GitHub
parent 67c795731d
commit f5dd55443b
8 changed files with 275 additions and 199 deletions
+18
View File
@@ -715,6 +715,24 @@ Deno.test({
},
});
Deno.test({
name: "404 from middleware",
fn: async () => {
const resp = await handler(
new Request(
"https://fresh.deno.dev/404-from-middleware",
),
);
assert(resp);
assertEquals(resp.status, Status.NotFound);
const body = await resp.text();
assertStringIncludes(
body,
"404 not found: /404-from-middleware",
);
},
});
Deno.test("jsx pragma works", async (t) => {
// Preparation
const { serverProcess, lines, address } = await startFreshServer({