Proposal: Revert override of jest default `resetMocks`
## About Hey what's up! I found myself trying to work out why all my tests broke when upgrading react-scripts and then realized it's because of the change to enabling `resetMocks` by default. I wanted to challenge this decision because, especially when react-scripts is targeted at newer users looking to use react, this causes [fundamental jest examples online](https://jestjs.io/docs/en/jest-object#jestcreatemockfrommodulemodulename) to break. ## App-wide mocks It also means app-wide mocks such as these don't work. ```js // some-mocked-module.js export const useSomeHook = jest.fn(() => true); ``` ```js // setupTests.js jest.mock('some-mocked-module', () => ({ useSomeHook: jest.fn(() => true) })) ``` For new users, I can see why it would be very confusing.
Posted by andyrichardson on Oct 28, 2020, 3:36 PM
Tags
Related issues
- 2026 - Microsoft Office 365
- [Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
- Gamut mapping
- [Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
- [Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
- [BUG]: infinite loading of videos
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
github (SaaS)
2026 - Microsoft Office 365
[Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
Gamut mapping
[Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
[Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
[BUG]: infinite loading of videos
Restore GPT-5.6 Sol’s 372k Codex context window, or provide an opt-in setting
Codex Desktop for macOS repeatedly triggers `syspolicyd` / `trustd` CPU and memory runaway
Proposal: Revert override of jest default `resetMocks`
## About Hey what's up! I found myself trying to work out why all my tests broke when upgrading react-scripts and then realized it's because of the change to enabling `resetMocks` by default. I wanted to challenge this decision because, especially when react-scripts is targeted at newer users looking to use react, this causes [fundamental jest examples online](https://jestjs.io/docs/en/jest-object#jestcreatemockfrommodulemodulename) to break. ## App-wide mocks It also means app-wide mocks such as these don't work. ```js // some-mocked-module.js export const useSomeHook = jest.fn(() => true); ``` ```js // setupTests.js jest.mock('some-mocked-module', () => ({ useSomeHook: jest.fn(() => true) })) ``` For new users, I can see why it would be very confusing.
Comments (0)
No comments yet. Start the discussion.