How do we clear the spy in a jasmine test suite programmatically? Thanks.
beforeEach(function() {
spyOn($, "ajax").andCallFake(function(params){
})
})
it("should do something", function() {
//I want to override the spy on ajax here and do it a little differently
})
I’m not sure if its a good idea but you can simply set the
isSpyflag on the function to false:But maybe its a better idea to create a new suite for this case where you need an other behavior from your spy.