# Category: mocking

My application loads a JSON file with the configuration before running app.run(). function loadConfig(options) { var $injector = angular.injector([‘ng’]); var Continue reading ## Angular test how to mock ActivatedRoute data I have a real big problem with mocking ActivatedRoute data property. No matter what I am doing all it ends Continue reading ## Angular 8: How to MOCK a Configuration Class (constants & static properties only in the class) I have an angular app that has the following TypeScript files: AppConstants.ts api.service.ts api.service.spec.ts Following is the code of the Continue reading ## TypeError: undefined is not a constructor in jasmine unit test with angularjs I am having above error in my Jesmine tests. Code has a Controller which calls AppsService service to receive a Continue reading ## component templateUrl not working with spec I’m running tests for an AngularJS component. I think by using templateUrl in my component, my spec/test file fails. In Continue reading ## AngularJS – mock window.location.replace for unit tests I have tried this solution How to mock$window.location.replace in AngularJS unit test? $window = {location: { replace: jasmine.createSpy()} }; Continue reading ## AngularJS doesn’t consider mocked service in jasmine tests I am trying to unit test an AngularJS service using Jasmine and Karma. The following is a minimal (obfuscated) representation Continue reading ## How to update$scope using Sinon test with \$interval.flush and clock.tick

So, I have a plunker setup with the sample code in question: http://plnkr.co/edit/HvMbtr6w3NtxZpsJY4BI?p=preview My problem, is that I have a