From e8586caafcaabb4b3d5507b9b9828c8b49b6fcac Mon Sep 17 00:00:00 2001 From: Vasilii Kovalev Date: Sat, 4 Jun 2022 21:11:51 +0300 Subject: [PATCH] docs: fix the example for `test.fails` function (#1429) --- docs/api/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/index.md b/docs/api/index.md index 49814bd01536..9cab1cfcba5e 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -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) }) ```