Brolands
Test react components, having difficulty with `document global not in Deno` using happy-dom
So, I tried your @magicrobots approach with
happy-dom
and also approach with jsdom
and for me with Deno v2.2.0 happy-dom
works much faster.
jsdom
- 60ms
happy-dom
- 26ms
What is interesting, with Deno.test
I don't know why, but tests were taking like 15 seconds with happy-dom
, so I thought it was much slower as jsdom
was consistent with 60ms. But after using @std/testing/bdd
library to have afterEach
with cleanUp
function in it to have multiple tests running, happy-dom
started to perform super fast.
So, again, thanks a lot for your setup example! I'm not yet sure if I need all of the properties you've setup for globalThis (not that much experience in FE development), but will see how it goes 🙂12 replies
Test react components, having difficulty with `document global not in Deno` using happy-dom
Nice, thanks a lot! I will try with
jsdom
approach that was mentioned in GitHub issue and then also with happy-dom
with your example and then see what I like best 🙂
Would be cool to put this somewhere as a tutorial, because I as well wanted to avoid jest
completely, as it didn't look so user friendly to me, when I first set it up12 replies
Test react components, having difficulty with `document global not in Deno` using happy-dom
Hello @magicrobots ,
Wondering whether you were able to make it work in the end with Deno 2?
After searching around, this looks to be the best example of the setup: https://github.com/udibo/react-app-example/tree/main
Curious if you did something different 🙂
12 replies