Skip to content

feat!: fail the test when an asynchronous assertion is not awaited - #10868

Merged
sheremet-va merged 1 commit into
mainfrom
feat/throw-unawaited-assertions
Aug 5, 2026
Merged

sheremet-va merged 1 commit into
mainfrom
feat/throw-unawaited-assertions

Conversation

@sheremet-va

Copy link
Copy Markdown
Member

Description

Un-awaited resolves/rejects/toMatchFileSnapshot assertions now fail the test with an error pointing at the assertion, instead of printing a warning. The error follows the same format as expect.poll. Vitest still settles the recorded promises at the end of the test, so a failing un-awaited assertion also reports its own error and doesn't leak an unhandled rejection.

Resolves #9089

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Throw an error if resolves/rejects/toMatchFileScreenshot is not awaited

2 participants