-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Bug]: jest-mock 29.2.0 does not allow spying on window.dispatchEvent anymore #13466
Labels
Comments
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version
29.2.0
Steps to reproduce
npm
cp package-npm.json package.json && npm install && npm test
=> worksrm package.json && rm package-lock.json && rm -rf node_modules && cp package-npm-broken.json package.json && npm install && npm test
=> does not workyarn
cp package-yarn.json package.json && npm install && npm test
=> works (i was not able to pin jest to29.1
with yarn. always results in a broken dependency tree somehow. So I used the also working version28
)rm package.json && rm yarn.lock && rm -rf node_modules && cp package-yarn-broken.json package.json && npm install && npm test
=> does not workExpected behavior
jest.spyOn(global.window, 'dispatchEvent');
does not throw an errordispatchEvent property does not exist
.Same with
window.window
and similar.Actual behavior
jest.spyOn(global.window, 'dispatchEvent');
does throw an errordispatchEvent property does not exist
after upgrading (I think)jest-mock
to version29.2.0
.I am not 100% sure but I think it's related to this change: #13398
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: