Skip to content

Commit abced97

Browse files
committed
Clarify docs - wording of mockRestore
1 parent a3e19c9 commit abced97

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

docs/MockFunctionAPI.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ Beware that `mockFn.mockClear()` will replace `mockFn.mock`, not just reset the
128128

129129
### `mockFn.mockReset()`
130130

131-
Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also removes any mocked return values or implementations.
132-
133-
This is useful when you want to completely reset a _mock_ back to its initial state. (Note that resetting a _spy_ will result in a function with no return value).
131+
Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also replaces the mock implementation with an empty function, returning `undefined`.
134132

135133
The [`resetMocks`](configuration#resetmocks-boolean) configuration option is available to reset mocks automatically before each test.
136134

website/versioned_docs/version-29.4/MockFunctionAPI.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ Beware that `mockFn.mockClear()` will replace `mockFn.mock`, not just reset the
128128

129129
### `mockFn.mockReset()`
130130

131-
Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also removes any mocked return values or implementations.
132-
133-
This is useful when you want to completely reset a _mock_ back to its initial state.
131+
Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also replaces the mock implementation with an empty function, returning `undefined`.
134132

135133
The [`resetMocks`](configuration#resetmocks-boolean) configuration option is available to reset mocks automatically before each test.
136134

website/versioned_docs/version-29.5/MockFunctionAPI.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ Beware that `mockFn.mockClear()` will replace `mockFn.mock`, not just reset the
128128

129129
### `mockFn.mockReset()`
130130

131-
Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also removes any mocked return values or implementations.
132-
133-
This is useful when you want to completely reset a _mock_ back to its initial state.
131+
Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also replaces the mock implementation with an empty function, returning `undefined`.
134132

135133
The [`resetMocks`](configuration#resetmocks-boolean) configuration option is available to reset mocks automatically before each test.
136134

website/versioned_docs/version-29.6/MockFunctionAPI.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ Beware that `mockFn.mockClear()` will replace `mockFn.mock`, not just reset the
128128

129129
### `mockFn.mockReset()`
130130

131-
Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also removes any mocked return values or implementations.
132-
133-
This is useful when you want to completely reset a _mock_ back to its initial state.
131+
Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also replaces the mock implementation with an empty function, returning `undefined`.
134132

135133
The [`resetMocks`](configuration#resetmocks-boolean) configuration option is available to reset mocks automatically before each test.
136134

0 commit comments

Comments
 (0)