Skip to content

Commit c70f29e

Browse files
antialiasthomasjinlo
authored andcommitted
manual mocks do not automatically take precedence over modules unless automock is true (jestjs#5710)
1 parent b11bda6 commit c70f29e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/ManualMocks.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ accordingly.
5353
```
5454

5555
When a manual mock exists for a given module, Jest's module system will use that
56-
module when explicitly calling `jest.mock('moduleName')`. However, manual mocks
57-
will take precedence over node modules even if `jest.mock('moduleName')` is not
56+
module when explicitly calling `jest.mock('moduleName')`. However, when
57+
`automock` is set to `true`, the manual mock implementation will be used instead
58+
of the automatically created mock, even if `jest.mock('moduleName')` is not
5859
called. To opt out of this behavior you will need to explicitly call
5960
`jest.unmock('moduleName')` in tests that should use the actual module
6061
implementation.

0 commit comments

Comments
 (0)