-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding webpack blocker to stop karma from running tests until build is finished #122
Conversation
@ibash - Perhaps a note in the readme ( preferably webpack.io ) so people don't have to go searching for the option |
@d3viant0ne What do you mean by preferably webpack.io? |
@ibash - The readme is fine for now. I retract my previous statement, loaders are at the moment outside the scope of the documentation project underway in webpack/webpack.io |
@d3viant0ne Added documentation - is it clear enough? Any suggestions on how to better explain what it does? |
No, that's perfect. Explanation of the feature and how to enable it was all I was looking for. |
@ibash - Actually, it would probably be a good idea to note the minimum karma version needed to use @MikaAK - Optionally we could add the minimum Karma version as a peerDep.
and tighten the devDeps.
|
@d3viant0ne / @MikaAK do you guys have a preference as to which we do? I lean more towards enforcing it in the package.json, but open to just noting it in the readme to (so that it doesn't force users to upgrade if they don't want to). |
done |
It feels like this should be a part of default behavior, maybe we can look into that @d3viant0ne. For now, it's great to have this under a flag. I think if this was default behavior I would add the peer dep but since this is a flag you have to enable, I would leave it as a note in the README so that users can still use versions under 1 without errors |
thanks! |
Do you guys have any example of how to use Thanks in advance! |
Sure -- in our karma.config.js we have:
Which makes it such that while developing, if I have karma in debug mode, make a code change, and then refresh, the karma tests won't run until the build is finished compiling. Does that make sense? For really fast builds this won't make that big of a difference, but for builds that take ~30s this can mean less confusing results when running the tests while developing. |
I've put my karma.conf file in Does the purpose of By the way, thanks for the fast answer! |
I don't see any reason it shouldn't work with |
When you make a code change and then refresh karma, sometimes karma will serve the old test files (because webpack is recompiling). This behavior can become annoying and waste time.
This change adds an optional middleware that will block karma from serving the test files until the build is complete.
Note that the middleware needs to be injected before karma's middleware, which is in this PR: karma-runner/karma#2143
We should hold off on merging until the karma PR above is merged.