Questions tagged [ngmocke2e]

ngMockE2E is an AngularJS module which contains mocks suitable for end-to-end testing.

ngMockE2E is an AngularJS module which contains mocks suitable for end-to-end testing. Currently there is only one mock present in this module - the e2e $httpBackend mock.

Docs:https://docs.angularjs.org/api/ngMockE2E

38 questions
0
votes
1 answer

Protractor http-backend-proxy 401 Unauthorized error

I am using protractor and mocking the backend calls using http-backend-proxy. I login and it makes a call which I have mocked. I then clear the token in the local storage using browser.executeScript( 'localStorage.clear();' ); And then I perform…
reutsey
  • 1,743
  • 1
  • 17
  • 36
0
votes
1 answer

How can I use regular expression to caught up urls in angularjs mocks?

I need to do something like that $httpBackend.whenGET('http://url:port/whatever').passThrough(); Till now, all the requests I were using were with this pattern $httpBackend.whenGET('myroute/whatever.html').passThrough(); However, I suppose I…
ackuser
  • 5,681
  • 5
  • 40
  • 48
0
votes
1 answer

ui routing in angular returning Unexpected request: GET

Below is my ui routing setup for my angular project. I am not able to bring up the work order list page. I am not sure what is wrong with the below setup, please can you advise how I can bring up the workorders list page to view my work orders. URL…
serah
  • 2,057
  • 7
  • 36
  • 56
0
votes
0 answers

AngularJS: Mock specific $http calls

I'm working on an AngularJS application that makes numerous $http calls. Most of these are working fine: the backends exist and returns the appropriate data. What I'm working on right now makes calls against an incomplete backend. How can I mock…
ricksmt
  • 888
  • 2
  • 13
  • 34
0
votes
1 answer

angular $httpBackend.when mocks - delay response NOT globally

I found this article how to create an artificial server delay when using $httpBackend for mocking data. Is there any way at all to have this on a per-mock basis? Perhaps something like: $httpBackend .whenGET(/\/my\/endpoint$/) …
parliament
  • 21,544
  • 38
  • 148
  • 238
0
votes
1 answer

Mock httpBackend protractor with ngMockE2E doesnt work

Folloing the basic guidelines as described here https://www.npmjs.com/package/ng-mock-e2e But still the normal REST call is being called. 'use strict' var HttpBackend = require('httpbackend'); var backend = null; var Injector =…
San Jay Falcon
  • 993
  • 1
  • 9
  • 20
0
votes
0 answers

Mocking API with usage of httpBackend and Protractor

I'm trying to mock up My API properly (as seen in question Mocking API with httpBackend [Protractor]). I'm navigating to specific URL - 'http://0.0.0.0:9000/#/organizations/profile'. Url requests specific view as seen here: Error: Unexpected…
0
votes
1 answer

How test controller who gets data from promise object

I have controller who gets data from promise object. Controller look like this: MyApp.controller("BookListController", ["$scope", "BookListModel","LibraryService", function($scope, BookListModel, LibraryService) { …
dejmien25
  • 153
  • 11
1 2
3