Not able to spyOn the interleaved success callback of an ajax in Jasmine unit testing
问题 In source code I have one getJSON call with two success callback in the following structure. Source code to test: jsonMakeLineOrderData = $.getJSON(url, jsonData, function (data) { console.log("Inside 1st callback"); //… some other statement }).success(function (data) { // line# 1 console.log("Inside 2nd callback"); //… some other statement }); I am using Jasmine testing framework to test the success blocks of this call. To fake/mock the ajax call I have used spyOn utility. My Jasmine test