DenoDDeno
Powered by
magicrobotsM
Denoβ€’15mo agoβ€’
14 replies
magicrobots

Test react components, having difficulty with `document global not in Deno` using happy-dom

I've done:
import { Window } from 'happy-dom';

const window = new Window();
const document = window.document;
globalThis.document = document;
import { Window } from 'happy-dom';

const window = new Window();
const document = window.document;
globalThis.document = document;

and still get the error when running
deno test --allow-a-bunch-of-stuff
deno test --allow-a-bunch-of-stuff
document global is not available in Deno. Any idea what I'm missing? Cheers y'all.
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

deno test on react template
ZweiEuroZZweiEuro / help
13mo ago
VSC having issues with NextJS using Deno
AirmanEpicAAirmanEpic / help
17mo ago
In-Source Testing with deno test?
EaiEEai / help
3y ago
Deno test fails(using - superoak)
BrandonBBrandon / help
14mo ago