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
Error when using with @testing-library/user-event / @testing-library/dom #544
Comments
…ly to solve a problem with Vitest typechecking the internals of Happy DOM.
…th-testing-libraryuser-event-testing-librarydom #544@patch: Does not set Event.target and Event.currrentTarget direct…
Thanks again for reporting @benbender! 🙂 I have created a fix that will not set Event.target and Event.currentTarget directly. However, you will probably run into more problems if you let Vitest transpile external libraries. You need to change the transform config to only transform your app source code to avoid this problem. transformMode: {
web: [/src\/\.[tj]sx?$/]
} You can read more about the release here: |
I'm trying to use
happy-dom
together with@testing-library/user-event
or@testing-library/dom
. When I try to emulate a click (viafireEvent
oruserEvent.click
, I'm seeing the following error:The reason is that
event.target
andevent.currentTarget
are readonly. I've provided a pr to fix the problem.The text was updated successfully, but these errors were encountered: