Mocking Javascript objects (specifically YUI)
I'm trying to mock YUI for javascript testing. I want to mock a datatable, but im not sure how to do it.
Something like
YAHOO.widget.DataTable = function(){
};
so latter I could do some开发者_如何学Gothing like
assert.that(returnedDatatable, isOfType(YAHOO.widget.DataTable));
My answer: js mockito or don't use YUI :)
精彩评论