Karma runner caching files/tests. It requires running tests twice.



Today I encountered problem with running tests using Webstorm karma runner.

When I change tests/code, first re-run works on previous code, only second rerun works on current code changes.


1. Run tests - fail

2. Change code to make tests pass

3. Run tests - fail

4. Run tests - pass (without changing anything, just another rerun)

I've checked it on Webstorm 2019.3 and 2019.1.4, both for mac os.

I've checked it also using Webstorm for Windows and it works fine.

Problem doesn't exist when I run test from console using 'ng test' command (angular 8 project).

It seems to be not related to karma or angular.

Comment actions Permalink

Can't reproduce. Could you record a screncast that shows up the issue? Do you save the file after altering the code?

Comment actions Permalink

Hah, saving files resolve the problem. I thought that running tests triggers autosaving. My fault ;)


Thanks :)


Please sign in to leave a comment.