feat: add render function (#2454)

This commit is contained in:
Luca Casonato
2024-05-24 18:31:34 +02:00
committed by GitHub
parent 82d027cbcd
commit f2162d24bf
14 changed files with 123 additions and 64 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import {
import { delay, FakeServer } from "../../test_utils.ts";
import { createFakeFs } from "../../test_utils.ts";
import { expect } from "@std/expect";
import type { HandlerByMethod, HandlerFn } from "../../handlers.ts";
import { type HandlerByMethod, type HandlerFn, page } from "../../handlers.ts";
import type { Method } from "../../router.ts";
import { parseHtml } from "../../../tests/test_utils.tsx";
@@ -544,7 +544,7 @@ Deno.test("fsRoutes - handler return data", async () => {
const server = await createServer({
"routes/index.tsx": {
handler: () => {
return { data: "foo", status: 404 };
return page("foo", { status: 404 });
},
default: (ctx) => {
// deno-lint-ignore no-explicit-any