When karma is auto-watching files, karma-webpack causes tests to occasionally run twice, possibly OS X-only
See original GitHub issueI have a larger project set up using gulp with karma’s watch to run tests on the fly.
I noticed that frequently when making updates to test files karma is watching, the tests get fired twice. After paring down my configurations, it looks like karma-webpack is the culprit.
I’m on OS X, so hopefully the repro works on whatever platform. Here are instructions/a barebones repo to isolate the issue and reproduce:
https://github.com/alanctkc/karma-webpack-watch-bug-repro#readme
Here’s a comparison of the output I get simulating changes with and without the ['webpack']
preprocessor:
https://gist.github.com/alanctkc/79c2c4586f13f22bd8e6
Unfortunately, it doesn’t seem to be super deterministic, so you might have to simulate changes a few times before seeing any duplicates. But, when the preprocessor is removed, there never seem to be any duplicate runs at all.
Any ideas?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
I got my config to work (it no longer runs tests twice) based on the browserify example mentioned above. Here it is for clarity:
Issue has multiple resolutions. Resolving