Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //how to spy on a normal java script function ???
- //note when I try to access it with $scope.arithmetic I am getting errors
- function arithmetic() {
- addFn(value1, value2);
- subFn(value1, value2);
- multFn(value 1, value 2);
- DivFn(value 1, value 2);
- }
- //spec.js
- .....
- .....
- spyOn(scope, 'arithmetic');
- scope.arithmetic();
- expect(scope.arithmetic).toHaveBeenCalled();
- //but I also want to check whether these functions add, mult .... have been called. so how do I do this?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement