Skip to content

Commit 27c4d9c

Browse files
saylerbSimenB
authored andcommitted
Grammar correction in Mock Function docs (#8399)
1 parent 46afa44 commit 27c4d9c

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

docs/JestObjectAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ Returns the `jest` object for chaining.
497497

498498
### `jest.restoreAllMocks()`
499499

500-
Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when mock was created with `jest.spyOn`; other mocks will require you to manually restore them.
500+
Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.
501501

502502
## Mock timers
503503

docs/MockFunctionAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Does everything that [`mockFn.mockReset()`](#mockfnmockreset) does, and also res
9898

9999
This is useful when you want to mock functions in certain test cases and restore the original implementation in others.
100100

101-
Beware that `mockFn.mockRestore` only works when mock was created with `jest.spyOn`. Thus you have to take care of restoration yourself when manually assigning `jest.fn()`.
101+
Beware that `mockFn.mockRestore` only works when the mock was created with `jest.spyOn`. Thus you have to take care of restoration yourself when manually assigning `jest.fn()`.
102102

103103
The [`restoreMocks`](configuration.html#restoremocks-boolean) configuration option is available to restore mocks automatically between tests.
104104

packages/jest-environment/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export interface Jest {
156156
* Restores all mocks back to their original value. Equivalent to calling
157157
* `.mockRestore` on every mocked function.
158158
*
159-
* Beware that jest.restoreAllMocks() only works when mock was created with
159+
* Beware that jest.restoreAllMocks() only works when the mock was created with
160160
* jest.spyOn; other mocks will require you to manually restore them.
161161
*/
162162
restoreAllMocks(): Jest;

website/versioned_docs/version-22.x/JestObjectAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ Returns the `jest` object for chaining.
373373

374374
### `jest.restoreAllMocks()`
375375

376-
Restores all mocks back to their original value. Equivalent to calling `.mockRestore` on every mocked function. Beware that `jest.restoreAllMocks()` only works when mock was created with `jest.spyOn`; other mocks will require you to manually restore them.
376+
Restores all mocks back to their original value. Equivalent to calling `.mockRestore` on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.
377377

378378
### `jest.resetModules()`
379379

website/versioned_docs/version-22.x/MockFunctionAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Removes the mock and restores the initial implementation.
6868

6969
This is useful when you want to mock functions in certain test cases and restore the original implementation in others.
7070

71-
Beware that `mockFn.mockRestore` only works when mock was created with `jest.spyOn`. Thus you have to take care of restoration yourself when manually assigning `jest.fn()`.
71+
Beware that `mockFn.mockRestore` only works when the mock was created with `jest.spyOn`. Thus you have to take care of restoration yourself when manually assigning `jest.fn()`.
7272

7373
### `mockFn.mockImplementation(fn)`
7474

website/versioned_docs/version-23.x/JestObjectAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ Returns the `jest` object for chaining.
374374

375375
### `jest.restoreAllMocks()`
376376

377-
Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when mock was created with `jest.spyOn`; other mocks will require you to manually restore them.
377+
Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.
378378

379379
### `jest.resetModules()`
380380

website/versioned_docs/version-23.x/MockFunctionAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Does everything that [`mockFn.mockReset()`](#mockfnmockreset) does, and also res
9393

9494
This is useful when you want to mock functions in certain test cases and restore the original implementation in others.
9595

96-
Beware that `mockFn.mockRestore` only works when mock was created with `jest.spyOn`. Thus you have to take care of restoration yourself when manually assigning `jest.fn()`.
96+
Beware that `mockFn.mockRestore` only works when the mock was created with `jest.spyOn`. Thus you have to take care of restoration yourself when manually assigning `jest.fn()`.
9797

9898
The [`restoreMocks`](configuration.html#restoremocks-boolean) configuration option is available to restore mocks automatically between tests.
9999

website/versioned_docs/version-24.0/JestObjectAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ Returns the `jest` object for chaining.
498498

499499
### `jest.restoreAllMocks()`
500500

501-
Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when mock was created with `jest.spyOn`; other mocks will require you to manually restore them.
501+
Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.
502502

503503
## Mock timers
504504

website/versioned_docs/version-24.0/MockFunctionAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Does everything that [`mockFn.mockReset()`](#mockfnmockreset) does, and also res
9999

100100
This is useful when you want to mock functions in certain test cases and restore the original implementation in others.
101101

102-
Beware that `mockFn.mockRestore` only works when mock was created with `jest.spyOn`. Thus you have to take care of restoration yourself when manually assigning `jest.fn()`.
102+
Beware that `mockFn.mockRestore` only works when the mock was created with `jest.spyOn`. Thus you have to take care of restoration yourself when manually assigning `jest.fn()`.
103103

104104
The [`restoreMocks`](configuration.html#restoremocks-boolean) configuration option is available to restore mocks automatically between tests.
105105

0 commit comments

Comments
 (0)