Friday, April 25th, 2008
JavaScriptMVC Test Plugin
<p>Justin Meyer and the JavaScriptMVC team have created a new Test plugin. We all voted testing as the number two pain point in Web dev and this is an attempt to make the world a bit better.
Test lets you simulate every major DOM event, as well as some combination events like Write and Drag, simulate Ajax, and use assertions. It runs functional and unit tests in a separate console window. Another nice feature is that if you use it with the Controller plugin, helper methods are automatically created that simulate each controller action's event, such as TodoClick.
Here's an example test function:
-
-
test_drag: function(){
-
// click the second todo
-
this.TodoClick(2);
-
// call done_dragging after Drag is complete
-
this.Drag($('draggable'),{from: 'pointA', to: 'pointB', callback: this.next_callback()})
-
},
-
done_dragging : function(){
-
// did the drag complete successfully
-
this.assert_equal(1, $('pointB').next().childNodes.length);
-
}
-
Check out the demo
Related Content:











It is nice to see more testing tools appearing. To see our Ajax-testing environment, see IT Mill Toolkit Testing Tools. To try out, try out management console demo at http://toolkit.itmill.com:8099/ or run a pre-recorded test at http://toolkit.itmill.com/demo/FeatureBrowser?TT=1&TT-TC=65&restartApplication
wow…. I cant fri*kin believe you linked to a site with a popup on it????? thats low
@henrah, assuming you’re referring to the demo, that popup is the test console window where you run unit and functional tests. It is not an advertisement. We’ll post a warning on the page for future visitors.