Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 510 Bytes

max-expects.md

File metadata and controls

36 lines (25 loc) · 510 Bytes

Enforce a maximum number of expect per test (vitest/max-expects)

⚠️ This rule warns in the 🌐 all config.

Rule Details

Examples of incorrect code for this rule with max: 1:

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

Examples of correct code for this rule:

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

Options

Default: 5

Maximum number of expect per test.

{
  max: number
}