autoWatch should work and report correct results with glob matchers of src/app/**/*.js
Reports are not updating to the correct result in autoWatch when using a matcher like src/app/**/*.js
karma --version):karma.config.js fileI've prepared an example project at -
https://github.com/shairez/karma-autowatch-problem-example
karma startExecuted 1 of 1 SUCCESS messageregistration.component.spec.jsctrl.createAccount() to ctrl.createAccount2()SUCCESS message from beforeI managed to find out that it's got to do with the glob matcher in the files configuration in karma.conf.js.
karma.conf.js, 'src/app/**/*.js''src/app/**/*.{component,service}.js'Something with 'src/app/**/*.js' breaks the autoWatch reporting behavior
The breakage here turns out to be due to the overly broad pattern of src/app/**/*.js - it turns out that this problem is not only limited to the test file being changed, but the watcher failing for any other file modified that falls under a subset of this pattern. One can add throw 'foo' to app.module.js and also see this fail.
What looks like is happening here is that there is a stale promise at https://github.com/karma-runner/karma/blob/master/lib/file-list.js#L346 . If one replaces that line with this.refresh(), this works, but it will cause the test runner to run twice. It is as if karma is serving files from memory instead of the direct file, so the stale ones are run again, which results in the stale test result.
Most helpful comment
The breakage here turns out to be due to the overly broad pattern of
src/app/**/*.js- it turns out that this problem is not only limited to the test file being changed, but the watcher failing for any other file modified that falls under a subset of this pattern. One can addthrow 'foo'toapp.module.jsand also see this fail.What looks like is happening here is that there is a stale promise at https://github.com/karma-runner/karma/blob/master/lib/file-list.js#L346 . If one replaces that line with
this.refresh(), this works, but it will cause the test runner to run twice. It is as if karma is serving files from memory instead of the direct file, so the stale ones are run again, which results in the stale test result.