mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-31 01:42:27 +00:00
20 lines
382 B
JavaScript
20 lines
382 B
JavaScript
import { JSDOM } from "jsdom";
|
|
|
|
export function createUiDom({
|
|
html = "<!DOCTYPE html><html><body></body></html>",
|
|
url = "https://bitvid.invalid/",
|
|
pretendToBeVisual = true,
|
|
} = {}) {
|
|
const dom = new JSDOM(html, {
|
|
url,
|
|
pretendToBeVisual,
|
|
});
|
|
|
|
const { window } = dom;
|
|
return {
|
|
window,
|
|
document: window.document,
|
|
cleanup: () => window.close(),
|
|
};
|
|
}
|