From abced97744102f5f51a98eddb531289f4240e8ce Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Mon, 21 Aug 2023 10:54:45 +0100 Subject: [PATCH] Clarify docs - wording of mockRestore --- docs/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-29.4/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-29.5/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-29.6/MockFunctionAPI.md | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/docs/MockFunctionAPI.md b/docs/MockFunctionAPI.md index 6bc4bcd24120..6282e1538f2d 100644 --- a/docs/MockFunctionAPI.md +++ b/docs/MockFunctionAPI.md @@ -128,9 +128,7 @@ Beware that `mockFn.mockClear()` will replace `mockFn.mock`, not just reset the ### `mockFn.mockReset()` -Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also removes any mocked return values or implementations. - -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). +Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also replaces the mock implementation with an empty function, returning `undefined`. The [`resetMocks`](configuration#resetmocks-boolean) configuration option is available to reset mocks automatically before each test. diff --git a/website/versioned_docs/version-29.4/MockFunctionAPI.md b/website/versioned_docs/version-29.4/MockFunctionAPI.md index 5ffb11992b84..6282e1538f2d 100644 --- a/website/versioned_docs/version-29.4/MockFunctionAPI.md +++ b/website/versioned_docs/version-29.4/MockFunctionAPI.md @@ -128,9 +128,7 @@ Beware that `mockFn.mockClear()` will replace `mockFn.mock`, not just reset the ### `mockFn.mockReset()` -Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also removes any mocked return values or implementations. - -This is useful when you want to completely reset a _mock_ back to its initial state. +Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also replaces the mock implementation with an empty function, returning `undefined`. The [`resetMocks`](configuration#resetmocks-boolean) configuration option is available to reset mocks automatically before each test. diff --git a/website/versioned_docs/version-29.5/MockFunctionAPI.md b/website/versioned_docs/version-29.5/MockFunctionAPI.md index 5ffb11992b84..6282e1538f2d 100644 --- a/website/versioned_docs/version-29.5/MockFunctionAPI.md +++ b/website/versioned_docs/version-29.5/MockFunctionAPI.md @@ -128,9 +128,7 @@ Beware that `mockFn.mockClear()` will replace `mockFn.mock`, not just reset the ### `mockFn.mockReset()` -Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also removes any mocked return values or implementations. - -This is useful when you want to completely reset a _mock_ back to its initial state. +Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also replaces the mock implementation with an empty function, returning `undefined`. The [`resetMocks`](configuration#resetmocks-boolean) configuration option is available to reset mocks automatically before each test. diff --git a/website/versioned_docs/version-29.6/MockFunctionAPI.md b/website/versioned_docs/version-29.6/MockFunctionAPI.md index 5ffb11992b84..6282e1538f2d 100644 --- a/website/versioned_docs/version-29.6/MockFunctionAPI.md +++ b/website/versioned_docs/version-29.6/MockFunctionAPI.md @@ -128,9 +128,7 @@ Beware that `mockFn.mockClear()` will replace `mockFn.mock`, not just reset the ### `mockFn.mockReset()` -Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also removes any mocked return values or implementations. - -This is useful when you want to completely reset a _mock_ back to its initial state. +Does everything that [`mockFn.mockClear()`](#mockfnmockclear) does, and also replaces the mock implementation with an empty function, returning `undefined`. The [`resetMocks`](configuration#resetmocks-boolean) configuration option is available to reset mocks automatically before each test.