chore: refresh release and test tooling

This commit is contained in:
joshpatra committed 2026-08-20 01:39:21 -04:00
1 parent eede171ad9
commit 0872b66686
11 files changed
+206 -252

No files matched your search

+3
View File
@@ -8,6 +8,7 @@ import { applyJSDOMWindow } from "./jsdom-globals.js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const repoRoot = path.resolve(__dirname, "..", "..");
let activeDom = null;
function readRepoFile(relPath) {
return fs.readFileSync(path.join(repoRoot, relPath), "utf8");
@@ -18,11 +19,13 @@ function readRepoFile(relPath) {
* top-level `const` redeclaration errors (avoids document.write).
*/
export function loadHtmlString(html, options = {}) {
if (activeDom) activeDom.window.close();
const dom = new JSDOM(html, {
url: options.url || "https://example.org/",
pretendToBeVisual: true,
runScripts: "dangerously"
});
activeDom = dom;
applyJSDOMWindow(dom.window);
}
+3
View File
@@ -4,6 +4,7 @@ const { JSDOM } = require("jsdom");
const vi = globalThis.vi;
const ROOT = path.resolve(__dirname, "..", "..");
let activeDom = null;
function clone(value) {
if (value === undefined) return undefined;
@@ -47,11 +48,13 @@ function applyJSDOMWindow(win) {
function loadHtmlString(html, options) {
const config = options || {};
if (activeDom) activeDom.window.close();
const dom = new JSDOM(html, {
url: config.url || "https://example.org/",
pretendToBeVisual: true,
runScripts: "dangerously"
});
activeDom = dom;
applyJSDOMWindow(dom.window);
}