diff --git a/etc/puppeteer.js b/etc/puppeteer.js index 9d561dc..9602425 100644 --- a/etc/puppeteer.js +++ b/etc/puppeteer.js @@ -1,6 +1,7 @@ const console = require("node:console"); const {writeFile} = require("node:fs/promises"); const {createServer} = require("node:http"); +const {join} = require("node:path"); const process = require("node:process"); const puppeteer = require("puppeteer"); const handler = require("serve-handler"); @@ -8,7 +9,7 @@ const handler = require("serve-handler"); // Run the test suite. (async function main() { const browser = await puppeteer.launch(); - const server = createServer((req, res) => handler(req, res, {public: "var"})); + const server = createServer((req, res) => handler(req, res, {public: join(__dirname, "../var")})); const page = await browser.newPage(); page.on("console", message => console.log(message.text())); @@ -21,7 +22,7 @@ const handler = require("serve-handler"); process.exit(code); }); - await writeFile("var/tests.html", ` + await writeFile(join(__dirname, "../var/tests.html"), `