import { router as r, ServerContext } from "../server.ts"; import { assert, assertEquals, assertStringIncludes } from "./deps.ts"; import routes from "./fixture/routes.gen.ts"; const router = r.router(ServerContext.fromRoutes(routes).routes()); Deno.test("/ page prerender", async () => { const resp = await router(new Request("https://fresh.deno.dev/")); assert(resp); assertEquals(resp.status, 200); assertEquals(resp.headers.get("content-type"), "text/html; charset=utf-8"); const body = await resp.text(); assertStringIncludes(body, "index.js"); assertStringIncludes(body, "

Hello!

"); assertStringIncludes(body, "

Viewing JIT render.

"); assertStringIncludes( body, `