Popular Posts
-
Kendo UI applying SUM in footer template kendo ui - KendoUI: Grid Summary values in Footer - Stack Overflow : ", footerTemplate:...
-
MVC grid example ASP.NET MVC Flexigrid sample - CodeProject : 'via Blog this'
-
A possible way of handling distributed transaction for multiple contexts without alleviation to MSDTC??? c# - Entity Framework - Using Trans...
Saturday, May 31, 2014
introduction.js
Jasmine testing function with callbacks ..
describe("Testing function callback", function () {
it("calls the callback", function () {
var callbackObject = new CallBackTest();
// NB: a dummy object with function success so can be used to check callback was called
var observer = {
success: function() {}
};
// spies always need an object and a method
spyOn(observer, "success");
callbackObject.doIt(observer.success);
expect(observer.success).toHaveBeenCalled();
});
});
function CallBackTest() {
this.doIt = function (success) {
return success();
};
}
'via Blog this'
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment