Zac Tolley
unread,Aug 12, 2009, 12:48:12 PM8/12/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Dr Nic's JavaScript projects
I need to test a library that does ajax calls, and gives you the usual
thing of a method that lets you pass a url and references to functions
to call when it goes good or bad, i.e.
ajax.request(url,success,failure);
I somehow want to test this though, if possible have he call to ajax
within the scope of a test and also when it calls a success or fail
function I want to run some asserts on the resulting data.
I even tried creating a new test run inside a success function, ala:
var success = function(result) {
new Test.Unit.Runner({
setup: function() {},
teardown: function() {},
testGoodAjaxCall : function() { with(this) {
assert(result.length > 0, true);
}},
});
};
but the test page just saying running.
Any suggestions?