Skip to content

Commit

Permalink
docs: describe mock result behavior with promises (#3635)
Browse files Browse the repository at this point in the history
  • Loading branch information
beckjake committed Jul 11, 2023
1 parent ee93762 commit 2f2e80f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/api/mock.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ This is an array containing all values, that were `returned` from the function.
- `'return'` - function returned without throwing.
- `'throw'` - function threw a value.

The `value` property contains returned value or thrown error.
The `value` property contains the returned value or thrown error. If the function returned a promise, when it resolves the `value` property will become the value the promise resolved to.

```js
const fn = vi.fn()
Expand Down Expand Up @@ -318,4 +318,4 @@ const a = new Spy()
Spy.mock.instances[0] !== a
Spy.mock.results[0] === a
```
:::
:::

0 comments on commit 2f2e80f

Please sign in to comment.