vitest/no-conditional-tests

January 2, 2026 ยท View on GitHub

๐Ÿ“ Disallow 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', () => {
  it('is awesome', () => {
    doTheThing()
  })
})