Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 513 Bytes

prefer-expect-resolves.md

File metadata and controls

15 lines (10 loc) · 513 Bytes

Enforce using expect().resolves over expect(await ...) syntax (vitest/prefer-expect-resolves)

⚠️ 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); });