Skip to content

Commit

Permalink
test: Add test for additionalPrerenderRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Nov 19, 2023
1 parent 54c5d02 commit 9d709ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ import preact from "../src/index";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [preact({ prerender: { enabled: true } })],
plugins: [
preact({
prerender: { enabled: true, additionalPrerenderRoutes: ["/404"] },
}),
],
});
2 changes: 2 additions & 0 deletions test/build.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ test("builds demo successfully", async () => {
assert.match(outputHtml, /Prerendered Preact App/); // Checks head.title
assert.match(outputHtml, /This is a prerendered Preact app/); // Checks head.elements
assert.match(outputHtml, /Hello from Preact/); // Checks body

assert.doesNotThrow(async () => await fs.access(dir("demo/dist/404/index.html")));
});

0 comments on commit 9d709ab

Please sign in to comment.