Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using happy-dom instead of jsdom? #340

Open
Uninen opened this issue Dec 30, 2021 · 1 comment
Open

Using happy-dom instead of jsdom? #340

Uninen opened this issue Dec 30, 2021 · 1 comment

Comments

@Uninen
Copy link

Uninen commented Dec 30, 2021

I'm using vitest, which aims to be for Jest what Vite is for webpack. Vitest defaults to happy-dom which is a faster and SSR-cabable alternative to jsdom. Is there a way to configure Pretender to using happy-dom instead of jsdom? (Not using Pretender first-party but Miragejs uses it and it allows full configuration for it as well.)

Apologies if this is the wrong place for user questions, didn't find anything from the docs.

@vincentx
Copy link

The underlaying issue here is that pretender intercepts XMLHttpRequest, which is not provided by happy-dom.

You can provide a polyfill in the setup file, and Pretender will work with happy-don’t happily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants