I have the following test:
it('should maintain a bind between the data at the $scope to the data at the ingredientsService', function(){
$scope.addFilters('val1', $scope.customFiltersData, 'filter1');
$scope.$digest();
expect($scope.customFiltersData).toEqual(ingredientsService.filters());
});
I get the following error:
TypeError: undefined is not a function
at Scope.$digest (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:12502:17)
at null.<anonymous> (/home/oleg/dev/vita-webapp-new/test/spec/controllers/customfilters.js:92:20)
When debugging I saw that $browser.$$checkUrlChange
on line 12502
of angular.js
is indeed undefined.
As a temporary solution, I changed the invocation on line 1250
to $browser.$$checkUrlChange && $browser.$$checkUrlChange()
But I cannot help to wonder whether this monkey-patch can hurt me in some other way.
Any clue on how to solve this properly is much appreciated.
In case I do not get my answers I might consider opening a bug at the Angular repo on GitHub.
You have a mismatch in the version of angular and angular-mock . See here:
jasmine test fails with undefined is not a function(evaluating $browser.$$checkUrlChange())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With