httpbackend Questions

3

I've searched around quite a bit on this problem, but can't find a solution. I'm trying to mock my backend, which is well tested so I can completely isolate my frontend. I've tried using protracto...

2

Getting the following error in my browser: Uncaught Error: [$injector:modulerr] Failed to instantiate module sayHiApp due to: Error: [$injector:modulerr] Failed to instantiate module ngMockE2E due...
Gynecoid asked 6/12, 2014 at 7:48

3

Solved

I've tried and tried to get this to work. The documentation is terse, at best: resetExpectations(); - Resets all request expectations, but preserves all backend definitions. Typically, you would ...
Gettysburg asked 18/8, 2014 at 19:2

2

Solved

I'm testing a sequence that polls a resource until a condition is met. Book = $resource("/books/:id", {id: "@id"}); function poll(success) { Book.get({id:1}, function() { if (canStop) { succes...
Carping asked 28/7, 2015 at 6:16

4

Angular's $httpBackend service lets you expect an HTTP request with expectGET, expectPOST, etc. (or just expect). How would I write a test that says, "the controller should NOT make a request to t...
Adams asked 14/3, 2014 at 15:56

3

Solved

I have the following controller (notice that at instantiation time I make an explicit call to $scope.getNotifications()): bla.controller("myctrl", [ "$scope", "$http", "configs", function ($scope...
Hashim asked 27/8, 2014 at 11:27

1

Solved

I just started writing my first unit tests in AngularJS via Jasmine. Somehow I still do not understand why I should mock the $httpBackend. To make clear what's still unclear to me I will write do...
Festoon asked 2/5, 2016 at 13:14

3

Solved

$httpBackend.whenGET('/restpath/api/v1/books') .respond({// some data}); I get the following error Error: Unexpected request: GET /restpath/api/v1/books Expected GET /restpath/api/v1/books?li...
Misgive asked 14/8, 2015 at 6:52

1

Solved

I am trying to test an AngularJS service carService, but the $httpBackend does not seem to work. //carService angular.module('services').factory('carService', function($http) { return { getType...
Ledoux asked 3/11, 2015 at 21:30

2

I am using the Angular.js $httpBackend to test some services that wrap $http calls (this is in ngMock, not ngMockE2E). It seems that things like expect and when are sensitive to the order of URL q...
Paraphrastic asked 12/3, 2014 at 20:28

1

Solved

When I try to use $httpBackend.flush(); I get error TypeError: $browser.cookies is not a function. I can't find any information about this kind of error and any solutions. describe("someText", fun...
Heaveho asked 27/5, 2015 at 16:16

1

Solved

I run my e2e tests against a mocked API using angular service $httpBackend in protractor. I already have the debug log of the selenium browser: afterEach(function() { browser.manage().logs().get...

1

Solved

I have an AngularJS service which performs an $http GET request and caches the response locally. It is designed to handle the multiple calls happening simultaneously, such that only the data from t...
Cowbane asked 3/2, 2015 at 18:8

2

Solved

I'm passing a url as a parameter in a $resource GET request. Angular is url encoding this parameter and matching the request in the $httpBackend.expectGET method is finicky. I see that you can us...
Turpin asked 21/10, 2013 at 14:29

1

Solved

I have a function in my scope to retrieve the status of my service when the user clicks a button, or when some event are triggered and this function is automatically called. This is my function, ...
Tetraspore asked 4/11, 2013 at 23:51

1

Solved

How do I test my API backend using AngularJS/karma/jasmine tests? I have tried to create the smallest test-case showing my error: echo_server.py from bottle import response, route, run @route('...

2

Solved

I'm gonna preface this question by saying I've already gotten a test to work for my "LoginCtrl" which performs almost the exact same task. I'm sure this is an issue of something really small I've o...
Disapprobation asked 4/9, 2013 at 16:41
1

© 2022 - 2024 — McMap. All rights reserved.