-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some docs on using
jest.mock(...)
(#5648)
* Add some docs on using `jest.mock(...)` I find the current docs on mocking lacking in the area of mocking an existing module. The hope is this example will show people a simple, real-world way to mock node modules (whether from npm or in their own projects). I looked through all the docs and couldn't find a clear example like this so I hope it is helpful to others! * Update based on PR feedback * Link markdown. * Fix example code to actually run 🤦♂️ * Ugh missing ) 🤦♂️ * Use "mockResolvedValue" instead" * Update CHANGELOG.md
- Loading branch information
1 parent
fbe05d3
commit aef82a2
Showing
2 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters