Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ sidebar: auto
## mount

Creates a Wrapper that contains the mounted and rendered Vue component to test.
Note that when mocking dates/timers with Vitest, this must be called after
`vi.setSystemTime`.

**Signature:**

Expand Down
9 changes: 9 additions & 0 deletions docs/guide/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

[[toc]]

## Mocking Dates and Timers with Vitest

Vue's scheduler depends on the system time. Make sure to mount components
*after* calling `vi.setSystemTime`, since Vue depends on its side effects.
Mounting components before calling `vi.setSystemTime` may cause breaks in
reactivity.

See [vuejs/test-utils#2074](https://github.com/vuejs/test-utils/issues/2074).

## Vue warn: Failed setting prop

```
Expand Down