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
Automock's default value is false, which gave me the expectation nothing is mocked at all.
For my project I started adding mocks at root level and manually calling jest.mock('a_node_module') which worked fine at first until I had a test where I did not explicitly called jest.mock but still ended up with a mocked version.
It took me a while to find this documentation
If the module you are mocking is a Node module (e.g.: lodash), the mock should be placed in the mocks directory adjacent to node_modules (unless you configured roots to point to a folder other than the project root) and will be automatically mocked. There's no need to explicitly call jest.mock('module_name').
It would be nice to add a reference to this piece of documentation or add an additional "note" to automock.
The text was updated successfully, but these errors were encountered:
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.
Automock's default value is false, which gave me the expectation nothing is mocked at all.
For my project I started adding mocks at root level and manually calling
jest.mock('a_node_module')
which worked fine at first until I had a test where I did not explicitly calledjest.mock
but still ended up with a mocked version.It took me a while to find this documentation
It would be nice to add a reference to this piece of documentation or add an additional "note" to automock.
The text was updated successfully, but these errors were encountered: