-
Notifications
You must be signed in to change notification settings - Fork 248
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
ng test --code-coverage fails (while "ng test" is ok) #460
Comments
I have a similar issue where "ng test" will run normally, but "ng test --code-coverage" takes a very long time ~24 hours to run. The issue seems to only affect Windows machines. The Macs that run the tests don't have the same issue. |
Could you provide repro steps? |
To Reproduce:
|
I just encountered the same error in a non-public Angular 11 project, i.e., the test passed with In my case, the class under test was extending an abstract class without explicitly defining a constructor method. This Stack Overflow post suggests that the DI mechanism is unaware of the base class which is causing the error. Based on that post, my workaround was to insert a constructor myself, instead of relying on the default constructor: @Component({
selector: 'foo',
template: `<p>bar</p>`,
})
export class DerivedComponent extends AbstractBaseComponent {
constructor(someService: SomeService) {
super(someService);
}
} |
Hi, during exploration of some third party library (swimlane/ngx-charts) i faced with an issue where command "ng test --code-coverage" fails while at the same time command "ng test" works ok. I raised an issue here swimlane/ngx-charts#1709 hoping that library authors already faced with this, but have no reply so far and to be honest it sounds more like an issue in current karma-coverage. In the above link I provided more details. My dev package.json config is as follow:
"devDependencies": { "@angular-devkit/build-angular": "~12.1.2", "@angular/cli": "~12.1.2", "@angular/compiler-cli": "~12.1.2", "@types/clone": "^2.1.1", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "clone": "^2.1.2", "codelyzer": "^6.0.2", "jasmine-core": "^3.7.1", "jasmine-spec-reporter": "~5.0.0", "karma": "^6.3.8", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "^2.1.0", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "karma-sonarqube-unit-reporter": "0.0.23", "ng-mocks": "^12.5.0", "protractor": "~7.0.0", "sonar-scanner": "^3.1.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "~4.3.5" }
Thanks in advance for any help with this
best regards
Darek
The text was updated successfully, but these errors were encountered: