by nwhit · 1y ago · 0 comments
All of the simple cases I've tried seem to work fine, e.g:
import { JSDOM } from "npm:jsdom";
const dom = new JSDOM(
`<!DOCTYPE html><p>Hello world <img src="https://example.com/logo.svg" /></p>`,
);
console.log(dom.window.document?.querySelector("p")?.textContent); // "Hello world"
console.log(dom.window.document?.querySelector("img")?.getAttribute("src")); // "https://example.com/logo.svg"I'll try again with a clearer head tomorrow, and maybe if I figure stuff out I can create a proper reproduction, but right now I don't know how to reproduce anything because it doesn't seem like my local environment is consistently reproducible, let alone trying to create something that would work on other machines. I'm surprised at how poor this behaviour is — I thought a big part of Deno@2 was to fix these sorts of dependency issues.