Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jsdom -> happy-dom migration with vitest is not simple

See original GitHub issue

Kind of a question for help, I’m trying to use happy-dom instead of jsdom using vitest, it should be as simple as changing the vitest environment setting. However, when I switch over, it comes with many issues. Such line as,

    await $radios[0].trigger('click')

Which worked fine before, doesn’t seem to do anything.

I also get weird fails saying value.trim is not a function on vue-test-utils…

const wrapper = mount(FormSelectOptionGroup, {` 

Component mounting function.

Also, on some other mounting functions, some will fill with TypeError: Cannot set properties of undefined (setting 'hasOwnProperty'), while others in the same file seemingly have no issues.

Any help would be appreciated. Here’s the repo, if anyone wants to take a deeper look and help me figure out what I’m doing wrong.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

capricorn86commented, Oct 14, 2022

I believe that the issues should be fixed now.

Big thanks to for @IGx89 for helping out with this! 🙂

Feel free to re-open otherwise.

You can read more about the releases here:

VividLemoncommented, Oct 14, 2022

There are two bugs for that as well (#571 and #618).

I will prioritize fixing those.

Thanks for that, I do think all of the errors do happen to stem from select and options. Though some stem from the inconsistencies between jsdom and this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Vitest
If you are running Vitest with --no-threads flag, your tests will be run in this order: node , jsdom , happy-dom , edge-runtime...
Read more >
Testing with Vitest - This Dot Labs
Vitest is a new testing framework powered by Vite. It's still in development, and some features may not be ready yet, but it's...
Read more >
Why I'm moving from Jest to Vitest - DEV Community ‍ ‍
Vitest makes migrating from Jest as easy as possible. ... As of v0.8, Vitest supports node , jsdom and happy-dom .
Read more >
Getting Started with Vitest | Vue Mastery
Vitest currently supports both happy-dom and jsdom. ... Vitest also makes it easy to migrate your existing tests from Jest to Vitest without ......
Read more >
Mirage/Pretender causes errors in Vitest - Stack Overflow
Setting the vite config test environment between happy-dom and 'jsdom' both give different errors, though they appear to be related or similar ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found