vitest/prefer-expect-resolves
January 2, 2026 ยท View on GitHub
๐ Enforce using expect().resolves over expect(await ...) syntax.
โ ๏ธ This rule warns in the ๐ all config.
๐ง This rule is automatically fixable by the --fix CLI option.
// bad
it('passes', async () => {
expect(await someValue()).toBe(true)
})
// good
it('passes', async () => {
await expect(someValue()).resolves.toBe(true)
})