You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Expected behavior
autoWatch should work and report correct results with glob matchers of
src/app/**/*.js
Actual behavior
Reports are not updating to the correct result in autoWatch when using a matcher like
src/app/**/*.js
Enviroment Details
karma --version
):1.1.0
karma.config.js
filefiles
Steps to reproduce the behaviour
I've prepared an example project at -
https://github.com/shairez/karma-autowatch-problem-example
Here are the steps:
karma start
Executed 1 of 1 SUCCESS
messageregistration.component.spec.js
ctrl.createAccount()
toctrl.createAccount2()
SUCCESS
message from beforeIt is solved when you change the glob matcher
I 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'
Bottom line
Something with
'src/app/**/*.js'
breaks the autoWatch reporting behaviorThe text was updated successfully, but these errors were encountered: