-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
🚀 Feature Proposal
Add more documentation on what auto-mocking do, especially for jest.genMockFromModule.
The purpose is to say how each type is transformed by Jest.
Motivation
You have to test the mocked object to know how each type is transformed by jest.
Example
- Function -> Create a mock function that returns undefined
- Async Function -> Create a mock function (synchronous) that returns undefined
- Object -> Do a deep copy of the object (keep the interface) and mock the sub elements
- Class -> Keep the interface and the type but all the functions are mocked
- Array -> Empty array
- String -> copy
- Number -> copy
- Date -> undefined
I could do the PR, however I would gladly appreciate a review of those assumptions.
Also, if some types are missing, let me know.
mlvl42, PeterChen1997 and natasha-audrey