Can somebody please tell me whether we need to use asyncTest() to test the synchronous ajax calls or test() can be used without start() and stop().
Consider this:
var Class= function () {
var init = function () {
amplify.request.define('students', 'ajax', {
url: '/methods/GetStudentsList',
dataType: 'json',
type: 'GET',
async:false
});
};
Students = function (branch, callback) {
init();
return amplify.request("students",
{ branchID: branch },
callback.success,
callback.error
);
};
return {
Students: Students
};
} ();
How can we write test cases for Class.Students() method when the 'async' property is 'true' and 'false' ?