How do I exclude files from karma code coverage report?

You can use several techniques here: karma uses minimatch globs for file paths and use can take advantage of that to exclude some paths. As first solution I’d say try to add only the paths of the file to preprocess with the coverage: // karma.conf.js module.exports = function(config) { config.set({ files: [ ‘src/**/*.js’, ‘test/**/*.js’ ], … Read more

Testing error case with observables in services

You can simply mock Observable throw error object like Observable.throw({status: 404})and test error block of observable. const xService = fixture.debugElement.injector.get(SomeService); const mockCall = spyOn(xService, ‘method’).and.returnValue(Observable.throw({status: 404})); Update 2019 : Since some people are lazy to read comment let me put this here : It’s a best practice to use errors for Rxjs import { throwError … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)