feat: add ctx.renderNotFound() to explicitly render 404 template (#481)
Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit is contained in:
co-authored by
Luca Casonato
parent
b169d18ecb
commit
49092ed83a
@@ -392,3 +392,14 @@ Deno.test({
|
||||
assertEquals(resp.headers.get("server"), "fresh test server");
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "/not_found",
|
||||
fn: async () => {
|
||||
const resp = await router(new Request("https://fresh.deno.dev/not_found"));
|
||||
assert(resp);
|
||||
assertEquals(resp.status, 404);
|
||||
const body = await resp.text();
|
||||
assertStringIncludes(body, "404 not found: /not_found");
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user