vitest/prefer-each
January 2, 2026 ยท View on GitHub
๐ 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')
})