Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 354 Bytes

File metadata and controls

21 lines (16 loc) · 354 Bytes

vitest/prefer-each

📝 Enforce using each rather than manual loops.

⚠️ This rule warns in the 🌐 all config.

// bad
for (const item of items) {
  describe(item, () => {
    expect(item).toBe('foo')
  })
}

// good
describe.each(items)('item', (item) => {
  expect(item).toBe('foo')
})