Skip to content

Commit

Permalink
test: Update build test case to check prerendering
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Oct 16, 2023
1 parent 5766993 commit b087058
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/build.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { execFile } from "node:child_process";
import { test } from "node:test";
import { promisify } from "node:util";
import { promises as fs } from "node:fs";
import assert from "node:assert";
import { dir } from "./util.mjs";

const execFileAsync = promisify(execFile);
Expand All @@ -12,4 +14,7 @@ test("builds demo successfully", async () => {
[dir("node_modules/vite/bin/vite.js"), "build"],
{ cwd: dir("demo"), encoding: "utf8" },
);

const outputHtml = await fs.readFile(dir("demo/dist/index.html"), "utf-8");
assert.match(outputHtml, /Hello from Preact/);
});

0 comments on commit b087058

Please sign in to comment.