I would like to pass some of my http request through and not mock them in my unit test, but when I try to call passThrough() method, an error of missing method is thrown:
"TypeError: Object # has no method 'passThrough'".
Does anybody know how I can fix it please?
There is my code:
'use strict';
describe('Controller: MainCtrl', function () {
// load the controller's module
beforeEach(module('w00App'));
var scope, MainCtrl, $httpBackend;
// Initialize the controller and a mock scope
beforeEach(inject(function(_$httpBackend_, $rootScope, $controller) {
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('http://api.some.com/testdata.json').passThrough();
scope = $rootScope.$new();
MainCtrl = $controller('MainCtrl', {
$scope: scope
});
}));
});