-
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
Karma removes file when you save in Visual Studio #887
Comments
That's probably because VS removes the file (I guess it moves the old file to a backup) and write a new file. Does it always happen? Karma has a delay (by default 250ms) - it waits for any subsequent changes and batches them. I'm surprised that it's not enough. I would expect another "add file" event to be fired. I think it's similar to #199. |
If you can, try watching a dir and not a single file. That fixed it for me. |
Visual Studio does have strange behaviour (write a new file with a temp name, delete the old file, rename the temp file in its place). This was the cause of #959. I've seen the behaviour described in this bug before; but it might've been on a previous version; don't think I've seen it on the latest version (with the fix for #959 included), but that's not to say it's not still there :( |
This is still the case, VS2013.3 . As GiffenGood says you can get around it by watching a dir and not the specific file. When I watched \dir*.js karma got into trouble with missing frameworks such as dojo in js-files I didn't want tested. The way around this was to watch \dir\TestFile1*.js instead of \dir\TestFile1.js . |
Is this still an issue? |
We are still getting around this by watching TestFile1*.js (instead of TestFile1.js) and have forgotten all about it, so I do not know. I will not be back at work before late August and cannot verify before that. |
I also see this issue with Visual Studio 2015 and Karma 0.13.9 |
This is also a problem in Intellij with Karma 1.1.2. Disabling the option 'save write' is my current "workaround". |
This is still happening on Visual Studio 2015 (update 3) and karma 1.3.0, The workaround as mentioned by @GiffenGood is to watch a folder instead of single files |
Is this something that can be addressed by the library? This seems like not great behavior by these editors in question, and not sure there is anything that can be done about this. |
Unfortunately I don't seem to be able to use the suggested workaround as options.files accepts an array of either specific file names or a folder such as /project/*.js -but not a combination of both. I need to add a bunch of libraries at the top of the list of files, followed by the tests. e.g.:
Or am I doing something wrong? |
@deejbee Karma uses https://github.com/isaacs/node-glob for pattern matching, so any valid glob patterns supported by the library work here. |
Still an issue. If i have something like this...
And myfile.js is removed and created during typescript build for example karma does not detect this as a change. Workaround is okay... But more or less dirty. So a fix would be realy nice. |
When you start Karma with autoWatch set to true and modify and save one of the files being watched in Visual Studio, Karma removes the file. This doesn't happen if you use Notepad++.
The text was updated successfully, but these errors were encountered: