Test Plugin For JavaScriptMVC
Developers generally neglect JavaScript testing because there’s really nothing out there that let’s you simulate user interactions easily. Here comes the Test plugin (Thanks to Brian Moschel from JavaScriptMVC for suggesting this resource).
It lets you simulate every major DOM event, as well as some combination events like Write and Drag, and then run functional and unit tests in a separate console window.
Test plugin saves serious development time with features like using sample data to simulating AJAX functionality, writing text or dragging an element.
Here is a sample test function:
test_check : function() {
// simulate clicking the checkbox
// params has the todo element
var params = this.TodoCheckClick();
// assert the color change occurs as expected
this.assert_equal("#808080", params.element.parentNode.style.color);
},
test_uncheck : function() {
// click the checkbox again to uncheck it
var params = this.TodoCheckClick();
// assert the color change goes away
this.assert_equal(”, params.element.parentNode.style.color);
},
Compatibility: All Major Browsers
Website: http://javascriptmvc.com/learningcenter/test/index.html
Demo: http://javascriptmvc.com/learningcenter/test/demo.html
- Tags:
- Filed under: Extras, Other License, Tools

















One Response for "Test Plugin For JavaScriptMVC"
Thanks guys for the great writeup. And thanks to Justin Meyer (http://jupiterit.com/index.html#people) for creating the idea and writing most of this plugin.