Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 439 Bytes

no-conditional-expect.md

File metadata and controls

27 lines (19 loc) · 439 Bytes

Disallow conditional expects (vitest/no-conditional-expect)

⚠️ This rule warns in the 🌐 all config.

Rule Details

This rule aims to prevent conditional expects.

Examples of incorrect code for this rule:

test('foo', () => {
  if (true) {
	expect(1).toBe(1)
  }
})

Examples of correct code for this rule:

test('foo', () => {
  expect(1).toBe(1)
})