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
TypeError: event.composedPath is not a function #468
Comments
@antalasztrik For what it's worth, I'm going through a similar process right now on a large React project which we've recently converted to vite + vitest. I've found that the vitest test environment can be overriden in individual tests by placing a comment at the top of the file:
For right now I'm experimenting with just doing this on the tests that fail and then having the majority of our suites run with happy-dom since the speed improvements seem pretty substantial. Might not work for your team but it seems like a reasonable approach for incremental adoption |
…osedpath-is-not-a-function #468@minor: Adds support for Event.composedPath().
Thanks for reporting @antalasztrik and @WonderPanda! 🙂 I have added support for Event.composedPath() now. Hopefully it will solve your issue. You can read more about the release here: |
Hey @capricorn86! Thank you for your work and the wonderful library, it works like a charm! Also thanks @WonderPanda, it was a great temporary solution as well! |
Hey there!
Issue
We wanted to use happy-dom with Vitest in our Vue project, but we've run into an issue. When running a test for one of our components, we wanted to test the onClickOutside sensor from VueUse, it gaves us an error.
Test
The test we've tried to run:
Error
And the complete error we got:
It seems like the error comes from
event.composedPath
not being implemented in happy-dom. The same test runs without any problems with jsdom.So my question would be: do you have any plans on addig this functionality to the project? We'd love to use happy-dom in our tests, but as of now we just can't.
Thank you in advance!
The text was updated successfully, but these errors were encountered: