-
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
AutoWatch doesn't work #895
Comments
@mzgol Can you run it with |
I'm having the same issue:
Karma recognizes the file change only once for every file it's watching. Edit: It works with version 0.10.10 |
It happens to me too. Version 0.12.0. It recognize the file change only once. I have a minimal setup:
|
Here's what breaking it, imho: If I set usePolling to true it works. Now I just have to understand why it doesn't work with usePolling=false; |
I think I'm gonna cry... Seriously. Can some OS finally make the file watching to work? Sounds like we should enable polling again, on all platforms (currently it is disabled on Mac where fsevents are buggy as well). I thought this worked on Linux ;-) I mean, I tested it a lot... @matteosuppo @mzgol @BassT what version of Node are you guys on? In the meantime, set |
I'm using the latest version
By the way it seems like Sublime Text could be the culprit, for me. If it's shut down, the file changes are detected. Maybe it is blocking them somehow? |
I digged up this: http://stackoverflow.com/questions/20634684/what-is-sublime-text-doing-when-i-save-a-file The problem for me was solved by changing |
Can other people having this issue try changing the Sublime settings? It's still weird, even if Sublime does |
karma 0.10.10 works fine for me. I'm gonna try 0.12 asap with changed sublime settings, though I recall that it wasn't working when I saved files with eclipse either. |
It starts picking up changes again after setting |
Wait, @BassT are you saying it works with karma 0.10.x but not with 0.12? Then, it's probably the |
If anybody interested in this, take a look at #974 |
Yup, |
I had the same issue on Intellij. It looks like you have to disable Use 'safe write' setting. |
|
Me too. Not using Sublime. Node: v0.10.25 usePolling: true fixes it. I have a possibly different setup where I'm running off a NAS and run node on unix (which obviously mounts the nas drive) but run WebStorm through Windows (ditto). |
Same for me sublime 3, usePolling:true restores previous behaviour, but using atomic_save: false in sublime instead for performance. |
|
Same for me still using sublime 2 where there seems to be no Updating karma config to with |
I'm having the same issue. I am seeing inconsistent behavior too -- some runs will re-run tests when I touch files in src/, other runs do not, with no changes to config. As of most recent runs, setting usePolling: true is working for changes made to source code, but not to tests. The former is under src/, the latter under test/ . I'm sorry to complain, as Karma is extremely useful when it works, but just to say, I have lost many days over the last year when new installs of Karma have one issue or another that I cannot track down. There are so many karma-* modules that depend on whichever version that this makes it difficult to try rolling back the version. It would be nice if it didn't break so frequently. At the moment, I can work around by killing and restarting Karma every time I add/modify a test, but this is a real pain. I'm on OS X 10.9.5. packages.json
karma.conf.js
}; |
I discovered something to do with WebStorm today. Running with "karma start" it works, usePolling = (false|true). |
Having the same issue, on ubuntu 14.10. Using vim, tried both karma 0.12.24 EDIT: I figured it out. In
Which when looking at watch logs came up as this:
Switching my files to Not sure if this is intended behaviour though |
This! I confirm it on my side; I had patterns like:
Switching it to:
makes the watcher work. So since the very beginning this issue for me had nothing to do with @vojtajina Why is this not glob-compatible? Is this intended? |
@mzgol it's because we watch only directory and in watcher.js we doesn't use glob library for getting directory. @mzgol patterns source of your problem? |
@maksimr Yes, this was my issue. I didn't even think that it may be a different pattern format issue. So it seems this issue should be closed unless you want to add support for groups to watcher.js. Other issues, with polling etc. are different to the issue I had and reported. |
Fix in canary branch |
If you're still having this problem, keep in mind that depending on the size of your project and the way you load your dependencies, karma might actually exceed the open files limit. See http://docs.basho.com/riak/latest/ops/tuning/open-files-limit for instructions on how to increase it. This is what worked for me. |
I can confirm disabling 'safe write' in Intellij solves the problem. thx @pallogu |
@maksimr mentions this is fixed in canary branch, however. I still experience the issue. Here is my workaround. Please let me know if this resolves the issue for anyone else. I've only tested this on Chrome, I'm sure similar approaches would work for the other browsers. Once you enter |
Hi guys, i had the same issue yesterday and none of these solutions worked for me, but i set singleRun in karma.conf.js to true which means it will run once and exit, then i watch the files with gulp.watch and on change i run karma from there, and i prefer this solution even if there is no problem with karma, because we have to check for UT while development too in one console. gulp.task('watch', function () { |
Although this is RE: intellij. fixed it on my linux box |
Hello all! I was searching why karma doesnt reload when file is changed. Now after 3-5 days of deep research i finally found a reason for this. It's not It's glob characters in the full path to watched file (in my case it was like C:\!JS\foo\bar.js, notice '!' in the beggining of JS). Reason for this here (paulmillr/chokidar#300 (issue from chokidar, which karma has in dependencies)). So consider to check names of your current working directory and files for '!', '*', '[', '{' and etc. Hope it helps to save a lot of time for someone because i would be really glad to find my message in the past. p.s. I decided to write message exactly here because it was the most common page which i was landing during my research :) |
If I run:
Karma doesn't react to file changes. Here are relevant files:
package.json:
karma.conf.js:
karma-shared.conf.js:
Watched
*.defs.js
files are generated via grunt-defs. Once a file is generated, Karma doesn't pick up the change and doesn't dispatch the tests.The text was updated successfully, but these errors were encountered: