You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cp package-npm.json package.json && npm install && npm test => works
rm package.json && rm package-lock.json && rm -rf node_modules && cp package-npm-broken.json package.json && npm install && npm test => does not work
yarn
cp package-yarn.json package.json && npm install && npm test => works (i was not able to pin jest to 29.1 with yarn. always results in a broken dependency tree somehow. So I used the also working version 28)
rm package.json && rm yarn.lock && rm -rf node_modules && cp package-yarn-broken.json package.json && npm install && npm test => does not work
Expected behavior
jest.spyOn(global.window, 'dispatchEvent'); does not throw an error dispatchEvent property does not exist.
Same with window.window and similar.
Actual behavior
jest.spyOn(global.window, 'dispatchEvent'); does throw an error dispatchEvent property does not exist after upgrading (I think) jest-mock to version 29.2.0.
I am not 100% sure but I think it's related to this change: #13398
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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
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: