From a41537bad0980a262c472faabae28ae7cbbdd67c 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-25.x/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-26.x/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-27.x/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-28.x/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-29.0/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-29.1/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-29.2/MockFunctionAPI.md | 4 +--- website/versioned_docs/version-29.3/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 +--- 12 files changed, 12 insertions(+), 36 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-25.x/MockFunctionAPI.md b/website/versioned_docs/version-25.x/MockFunctionAPI.md index 3cbc6e53f6ad..2182b7f08f7a 100644 --- a/website/versioned_docs/version-25.x/MockFunctionAPI.md +++ b/website/versioned_docs/version-25.x/MockFunctionAPI.md @@ -93,9 +93,7 @@ Beware that `mockClear` will replace `mockFn.mock`, not just these three propert ### `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-26.x/MockFunctionAPI.md b/website/versioned_docs/version-26.x/MockFunctionAPI.md index 3cbc6e53f6ad..2182b7f08f7a 100644 --- a/website/versioned_docs/version-26.x/MockFunctionAPI.md +++ b/website/versioned_docs/version-26.x/MockFunctionAPI.md @@ -93,9 +93,7 @@ Beware that `mockClear` will replace `mockFn.mock`, not just these three propert ### `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-27.x/MockFunctionAPI.md b/website/versioned_docs/version-27.x/MockFunctionAPI.md index a5eb6f45a7de..d9ec7bab6b94 100644 --- a/website/versioned_docs/version-27.x/MockFunctionAPI.md +++ b/website/versioned_docs/version-27.x/MockFunctionAPI.md @@ -103,9 +103,7 @@ Beware that `mockClear` will replace `mockFn.mock`, not just these three propert ### `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-28.x/MockFunctionAPI.md b/website/versioned_docs/version-28.x/MockFunctionAPI.md index 17f429f7fe0e..377c5448b1d6 100644 --- a/website/versioned_docs/version-28.x/MockFunctionAPI.md +++ b/website/versioned_docs/version-28.x/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.0/MockFunctionAPI.md b/website/versioned_docs/version-29.0/MockFunctionAPI.md index 8d47e75d466c..8d9acbff72c1 100644 --- a/website/versioned_docs/version-29.0/MockFunctionAPI.md +++ b/website/versioned_docs/version-29.0/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.1/MockFunctionAPI.md b/website/versioned_docs/version-29.1/MockFunctionAPI.md index 366416132da9..2bed632dc387 100644 --- a/website/versioned_docs/version-29.1/MockFunctionAPI.md +++ b/website/versioned_docs/version-29.1/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.2/MockFunctionAPI.md b/website/versioned_docs/version-29.2/MockFunctionAPI.md index 366416132da9..2bed632dc387 100644 --- a/website/versioned_docs/version-29.2/MockFunctionAPI.md +++ b/website/versioned_docs/version-29.2/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.3/MockFunctionAPI.md b/website/versioned_docs/version-29.3/MockFunctionAPI.md index d6b84aa49686..9599035b2743 100644 --- a/website/versioned_docs/version-29.3/MockFunctionAPI.md +++ b/website/versioned_docs/version-29.3/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.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.