Skip to content

Commit

Permalink
docs: fix the example for test.fails function (#1429)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilii-kovalev committed Jun 4, 2022
1 parent 3181708 commit e8586ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/api/index.md
Expand Up @@ -162,8 +162,8 @@ In Jest, `TestFunction` can also be of type `(done: DoneCallback) => void`. If t
```ts
import { expect, test } from 'vitest'
const myAsyncFunc = () => new Promise(resolve => resolve(1))
test.fails('fail test', () => {
expect(myAsyncFunc()).rejects.toBe(1)
test.fails('fail test', async () => {
await expect(myAsyncFunc()).rejects.toBe(1)
})
```

Expand Down

0 comments on commit e8586ca

Please sign in to comment.