-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Reload config file when it changes #595
Comments
I think this would be fine as long as there is also an option to keep whatever Karma server is currently running running, maybe an --ignore-conf-changes or something? |
This is a great feature, it's been on my todo list for quit a while now... The problem is, that the config file can include other files ;-) and that makes watching a bit harder... |
Wouldn't watching the config file alone provide 80% of the value? I don't have any idea of how common it is to include other files from the config file, but if it's a significant use case, one way to handle it would be to provide a configuration option similar to client files. |
But if you watch only the config file, how will Karma know to rerun tests if one of the files you're including changes? |
Seems like a dead issue now, but +1, my situation is that I have a karma server running, watch tasks triggering changes and running tests, all fine. However when I need to add new files to the karma.conf.js, I can't find a way to update the config, so new files aren't known and I have to manually restart the karma server grunt task so it reloads the config. I don't see why a change to the config would require re-running of the tests, changing src code should still be responsible for triggering the watch task. |
I would just like to add that some folks (including myself) pass the karma config as a parameter to the gulp.task('karma', function (done) {
karmaServer.start(config.karma, done);
}); Where I trust that a manual restart is subsumed by this issue, but I am happy to open another. (p.s. ❤️ karma) |
I'm not a 100% sure this is such a great idea, so I'm closing this issue. Feel free to discuss here and I might reopen it. |
@dignifiedquire I think it's a good feature. Because, we don't have to use gulp or grunt type build systems; at least npm might be sufficient. Especially, when configuring something or when building a new project, this would become handy, I lived that. Currently, I wrote a bash script to do that, but native support would be good. |
How can we add this to karma? |
With |
I was surprised to see that after adding |
When the karma.conf.js file changes, reload it. Currently, changes to the config file aren't reflected in later test runs until you manually restart Karma, which can be very confusing.
If reloading the config file is difficult, a graceful exit with an error message is also fine.
This was reproduced in Karma 0.8.5. Apologies if this has been resolved since then; a quick search of the issue list didn't reveal anything.
The text was updated successfully, but these errors were encountered: