Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 492 Bytes

no-conditional-tests.md

File metadata and controls

31 lines (24 loc) · 492 Bytes

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

⚠️ This rule warns in the 🌐 all config.

Rule Details

Examples of incorrect code for this rule:

describe('my tests', () => {
	if (true) {
		it('is awesome', () => {
			doTheThing()
		})
	}
})

Examples of correct code for this rule:

describe('my tests', () => {
	if (Math.random() > 0.5) {
		it('is awesome', () => {
			doTheThing()
		})
	}
})