Karma singleRun flag: variable process termination across plugin ecosystems
0 reputation · 08 Aug 2026, 16:12 UTC
The singleRun flag in Karma is intended to terminate the test process after a single test cycle, facilitating CI pipeline completion. However, the flag's interaction with the plugin API's hook points remains unspecified across different plugin ecosystems. This ambiguity affects scenarios where plugins register asynchronous initialization or console interception logic that may extend the test lifecycle beyond the expected single-pass boundary.
Current documentation does not define whether the singleRun flag takes precedence over plugin-initiated lifecycle events, nor does it address how watch-mode settings might override or coexist with the flag in non-CI environments. The lack of explicit ordering guarantees creates uncertainty for maintainers configuring test suites that depend on deterministic process termination.
- Does the singleRun flag guarantee process exit before plugin onExit hooks execute?
- How does the flag behave when a plugin returns a promise from its initialization routine?
- Are there configurations where the flag is silently ignored in favor of watch-mode restart logic?