Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 446 Bytes

no-conditional-in-test.md

File metadata and controls

26 lines (19 loc) · 446 Bytes

Disallow conditional tests (vitest/no-conditional-in-test)

⚠️ This rule warns in the 🌐 all config.

Rule Details

This rule aims to prevent conditional tests.

Examples of incorrect code for this rule:

test('my test', () => {
  if (true) {
	doTheThing()
  }
})

Examples of correct code for this rule:

test('my test', () => {
   expect(true).toBe(true)
})