Skip to content

Commit

Permalink
amend wording: prefer its to their referring to an implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordfirespeed committed Aug 21, 2024
1 parent 922242f commit ffb7945
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/api/vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,12 @@ This will clear mock history and reset each implementation to an empty function
### vi.restoreAllMocks

Calls [`.mockRestore()`](/api/mock#mockrestore) on all spies.
This will clear mock history, restore each implementation to their original, and restore original descriptors of spied-on objects.
This will clear mock history, restore each implementation to its original, and restore original descriptors of spied-on objects.

### vi.revertAllMocks

Calls [`.mockRevert()`](/api/mock#mockrevert) on all spies before each test.
This will clear mock history and revert each implementation to their original without restoring original descriptors of spied-on objects.
This will clear mock history and revert each implementation to its original without restoring original descriptors of spied-on objects.

### vi.spyOn

Expand All @@ -409,7 +409,7 @@ expect(spy).toHaveReturnedWith(1)
```

::: tip
You can call [`vi.restoreAllMocks`](#vi-restoreallmocks) inside [`afterEach`](/api/#aftereach) (or enable [`test.restoreMocks`](/config/#restoreMocks)) to restore all methods to their original implementations. This will restore the original [object descriptor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty), so you won't be able to change method's implementation:
You can call [`vi.restoreAllMocks`](#vi-restoreallmocks) inside [`afterEach`](/api/#aftereach) (or enable [`test.restoreMocks`](/config/#restoreMocks)) to restore all methods to its original implementations. This will restore the original [object descriptor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty), so you won't be able to change method's implementation:

```ts
const cart = {
Expand Down
4 changes: 2 additions & 2 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1828,15 +1828,15 @@ This will clear mock history and reset each implementation to an empty function
- **Default:** `false`

Will call [`.mockRestore()`](/api/mock#mockrestore) on all spies before each test.
This will clear mock history, restore each implementation to their original, and restore original descriptors of spied-on objects.
This will clear mock history, restore each implementation to its original, and restore original descriptors of spied-on objects.

## revertMocks

- **Type:** `boolean`
- **Default:** `false`

Will call [`.mockRevert()`](/api/mock#mockrevert) on all spies before each test.
This will clear mock history and revert each implementation to their original without restoring original descriptors of spied-on objects.
This will clear mock history and revert each implementation to its original without restoring original descriptors of spied-on objects.

### unstubEnvs {#unstubenvs}

Expand Down

0 comments on commit ffb7945

Please sign in to comment.