Closed as not planned
Description
🚀 Feature Proposal
As described in the thread https://twitter.com/kentcdodds/status/1182744387190607872, we should set resetMocks param to true by default.
Motivation
In order to make our tests isolated.
Example
thanks to this new default value, we won't have to define afterAll method in our unit tests, in order to reset something.
afterEach(() => {
jest.clearAllMocks()
})
Pitch
This feature is part of the core project . https://jestjs.io/docs/en/configuration#resetmocks-boolean. This change will make de developer experience smoother when writing unit test with jest.
As writing isolated test is a good practice, we should make it easy to implement, without writing extra code.
Why does this feature belong in the Jest core platform?
Common feature proposals that do not typically make it to core:
- New matchers (see jest-extended)
- Changes to the default reporter (use custom reporters instead)
- Changes to node/jsdom test environments (use custom environments instead)