Skip to content

Commit

Permalink
docs: clarify expect.toMatchFileSnapshot (#6610)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Oct 2, 2024
1 parent d2a86ff commit 1bacfea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/expect.md
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ it('render basic', async () => {
})
```

Note that since file system operation is async, you need to use `await` with `toMatchFileSnapshot()`.
Note that since file system operation is async, you need to use `await` with `toMatchFileSnapshot()`. If `await` is not used, Vitest treats it like `expect.soft`, meaning the code after the statement will continue to run even if the snapshot mismatches. After the test finishes, Vitest will check the snapshot and fail if there is a mismatch.

## toThrowErrorMatchingSnapshot

Expand Down

0 comments on commit 1bacfea

Please sign in to comment.