Reputation: 29750
I have a Jasmine unit test and in it I have this 'expect'...
expect(mockService.create).toHaveBeenCalledWith(new ToDoItem('[email protected]', 'get milk'));
In my controller I have the following...
todoService.create($scope.newToDo,
function() {
}, function() {
});
But I always get an error because of the final two functions that I pass the service for success and failure. How can I stop this from happening? How do I add them to the expect clause?
Thanks
Upvotes: 0
Views: 917
Reputation: 2483
You may be able to use jasmine.any(Function)
, or jasmine.objectContaining
.
Fair warning, I've never done this myself. However, from the documentation, at least one of them should provide the behaviour you want.
Upvotes: 2