feat: add config option to disable runtime js (#36)
The config option can be toggled per page:
```js
export const config: PageConfig = { runtimeJS: false };
```
This commit is contained in:
@@ -85,3 +85,15 @@ Deno.test("/api/xyz not found", async () => {
|
||||
assert(resp);
|
||||
assertEquals(resp.status, 404);
|
||||
});
|
||||
|
||||
Deno.test("/static page prerender", async () => {
|
||||
const resp = await router(new Request("https://fresh.deno.dev/static"));
|
||||
assert(resp);
|
||||
assertEquals(resp.status, 200);
|
||||
assertEquals(resp.headers.get("content-type"), "text/html; charset=utf-8");
|
||||
const body = await resp.text();
|
||||
assert(!body.includes(`static.js`));
|
||||
assert(!body.includes(`</script>`));
|
||||
assertStringIncludes(body, "<p>This is a static page.</p>");
|
||||
assert(!body.includes("__FRSH_PROPS"));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user