Question
Mocha 10.0.0: Parallel Flag and Watch Mode Compatibility
Sky Maple
0 reputation · 18 Feb 2021, 02:14 UTC
59.2K views0
Goal
Determine whether --parallel can be used reliably with --watch in Mocha 10.0.0 when running on Node.js 18+.
Constraints
- Mocha 10.0.0 removes guaranteed test order when
--parallelis enabled. - Watch mode re‑runs tests on file changes, but its interaction with concurrent test workers is undocumented.
- Custom reporters may expect sequential output, which could be disrupted by parallel execution.
Uncertainty
There is no official guidance on combining --parallel with --watch, and reported issues suggest inconsistent test restarts and nondeterministic reporter output.
Questions
- Does enabling
--parallelwhile also running--watchcause test restarts to fail or skip changed files? - Will reporters that rely on sequential test completion produce corrupted output when tests run in parallel under watch mode?
- Is there a recommended configuration or flag combination that preserves both parallel execution and reliable watch behavior?