Mocha Async Test Looping with it.each

JSON →
library 0.5.0 ·javascript maintenance
verified May 27, 2026

it-each is a JavaScript module designed to extend Mocha's testing capabilities by enabling asynchronous test looping. It allows developers to iterate over data sets, executing a test case for each item with configurable titles and data extraction. The package, currently at version 0.5.0, explicitly states it is below v1.0.0 due to an unclear roadmap, implying potential breaking changes, though stability is aimed for. It operates by modifying Mocha's global `it` handler and works with Mocha v2.1.0 and likely newer versions, though no guarantees are made for future compatibility. Key features include automatic adjustment of `timeout` and `slow` values for collective tests, and an option (`testPerIteration`) to generate a separate test entry for each iteration, which helps in isolating failures. Its primary differentiator is its simplicity and direct integration into Mocha's existing `it` interface, making it easy to adapt existing tests for data-driven scenarios.

total hits 15
actors 7 distinct systems
last hit 18h ago human
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
Search engines
1
Humans
1

top countries 🇺🇸 United States · 🇺🇦 Ukraine · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany