Top "Angular-mock" questions

angular-mock (or ngMock) is a module of the AngularJS framework providing features helpful for testing.

Angular mock fails to inject my module dependencies

I want to test an Angular controller for my application fooApp, defined as follow: var fooApp = angular.module('fooApp', [ 'ngRoute', …

angularjs jasmine karma-runner karma-jasmine angular-mock
How to mock an angular $http call and return a promise object that behaves like $http

Is there a way to return an HttpPromise (or something similar) to mimic a call to $http? I want to …

angularjs angularjs-http angular-mock
angular mock `module` resulting in '[Object object] is not a function'

I'm trying to create some unit tests in Angular using Jasmine being run through Teaspoon. The tests are running, however …

angularjs angular-mock teaspoon
How do I mock $window injected manually in provider private function?

I have the following provider: angular.module('MyApp').provider('MyDevice', function () { var ngInjector = angular.injector(['ng']), $window = ngInjector.get('$…

angularjs unit-testing karma-jasmine angular-mock
Mocking rest calls in functional e2e protractor tests in angular 4 project

We have a huge project and we have written a lot of test cases to cover a lot of real …

angular protractor angular-mock angular-e2e angular-test
Use Angular mock to load JSON file for Backendless development

I wrote this little code in separate .js file for frontend backendless environment. I need to get myfile.json whenever …

javascript ajax json angularjs angular-mock
How to return a file content from angular's $httpBackend?

I'm trying to setup an e2e test suite in angular, and need to return canned responses using $httpBackend. It …

javascript angularjs angular-mock
what's the correct way to import angular-mocks

Versions typescript: 2.1.4 systemjs: 0.19.41 angular: 1.5.10 angular-mocks: 1.5.10 Problem I'm trying to load angular-mocks with systemjs in a typescript 2.0 project. If i use …

angularjs systemjs angular-mock
How to Jasmine test code within angular module run block

I would like to Jasmine test that Welcome.go has been called. Welcome is an angular service. angular.module('welcome',[]) .…

javascript angularjs unit-testing jasmine angular-mock