Testing with Ajax
Testing with Ajax
I am a newbie to QUnit. I want to test the ValidatePhoneNumber function which has a callback as follows. Would anyone help me to write a test in QUnit for this function? Thanks
ValidatePhoneNumber: function (userName, successCallback, errorCallback) {
VaultModel.callService(successCallback, errorCallback);
}
callService: function (successCallback, errorCallback) {
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
$.ajax({
success: successCallback,
error: errorCallback
});
}