Skip to content

Commit

Permalink
docs: add missing Vitest spy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Sep 8, 2023
1 parent 398a1b3 commit ca28afb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,25 @@ require("console-fail-test").cft({
</a>
</td>
</tr>
<tr>
<td>Vitest</td>
<td>
✅️
</td>
<td>
<code>"vitest"</code>
</td>
<td>
<a href="https://vitest.dev/guide/mocking.html#functions">
<code>vi.fn()</code>
</a>
</td>
<td>
<a href="./docs/Vitest.md#spies">
<code>Vitest.md#spies</code>
</a>
</td>
</tr>
</tbody>
</table>

Expand Down
6 changes: 6 additions & 0 deletions docs/Vitest.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ import * as vitest from "vitest";

require("console-fail-test").cft();
```

## Spies

Global `console` methods will be replaced by `vi.fn()` spies.
You can inspect them at runtime as usual per vitest spies.
See vitest's [mock functions docs](https://vitest.dev/guide/mocking.html#functions).

0 comments on commit ca28afb

Please sign in to comment.