import type { PageProps } from "./render.ts"; import { assertType, type IsExact } from "@std/testing/types"; import { expect } from "@std/expect"; import { type defineApp, type defineLayout, defineRoute } from "./compat.ts"; Deno.test("compat - defineFn works", () => { const ctx = {} as PageProps; expect(defineRoute(() => new Response("test"))(ctx)).toBeInstanceOf(Response); expect(defineRoute(() => test)(ctx)).toBeInstanceOf(Object); expect(defineRoute(() => null)(ctx)).toEqual(null); }); Deno.test("compat - functions equivalent", () => { assertType>(true); assertType>(true); });