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
{{ message }}
Repository navigation
[Feature]: Better error message if using old jsdom #16168
If user updated minor version of jest to 30.4 (I know this happens if previous version was 30.2) and forgets to update jest-environment-jsdom to version 30, then he gets a bit cryptic error message:
Test suite failed to run
TypeError: this._moduleMocker.clearMocksOnScope is not a function
at Runtime.resetModules (../jest/packages/jest-runtime/build/index.js:3781:28)
It would be nice if user instead got error message, that would help him fix the issue (in a sense of "update your jsdom").
Motivation
Without proper error message, people might get lost and spend a lot of time trying to figure out what went wrong.
Example
Running the test with old version should produce an error of "update your jest-environment-jsdom to latest version"
Pitch
Because it's about interoperability between jest and it's component
Reacted by Lucas Cimon, Sheng-Han (Aysh) Su, Eren Doğruca, Peter Zmilczak, Jonathan Merlet, Samuel Martineau, Emil Junker, Paul Schreiber, Tomisin Alu and Sʜɪᴍᴜʀᴀ Yū
Just had this issue today and I was only able to fix it because I found this issue and for me it was for jest-environment-node instead of jest-environment-jsdom
Reacted by Adam ElKhayyat, Peter Zmilczak, Emil Junker and Samuel Martineau
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.
Activity
jmuransky commentedon May 12, 2026
I fully intend to write my pull request for this very soon.
Upgrade jest-environment-jsdom
eroo36 commentedon Jun 2, 2026
Just had this issue today and I was only able to fix it because I found this issue and for me it was for jest-environment-node instead of jest-environment-jsdom
marwin1991 commentedon Jun 16, 2026
+1
github-actions commentedon Jul 17, 2026
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.
SimenB commentedon Aug 28, 2026
https://github.com/jestjs/jest/releases/tag/v30.5.0