angularjs - Errors with .passThrough() using angular E2E -
i trying test real api using angular mocke2e, getting errors using .passthrough function.
here code:
describe('simple test', function () { var $controller, $httpbackend; beforeeach(module('uca-app')); beforeeach(inject(function ($rootscope, _$controller_, _$httpbackend_, _signupservice_, _userservice_) { $controller = _$controller_; $httpbackend = _$httpbackend_; signupservice = _signupservice_; userservice = _userservice_; $scope = $rootscope.$new(); $httpbackend.whenget('http://localhost:2684/api/account/getpasswordpolicymessage').passthrough(); })); });
which returns error:
error: unexpected request: http://localhost:2684/api/account/getpasswordpolicymessage
the method trying test runs default on controller, when change passthough expect so:
$httpbackend.expectget('http://localhost:2684/api/account/getpasswordpolicymessage').passthrough();
i error:
typeerror: $httpbackend.expectget(...).passthrough not function
any ideas doing wrong, or if should setting differently testing actual api?
Comments
Post a Comment