QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery project to test its code and plugins but is capable of testing any generic JavaScript code (and even capable of testing JavaScript code on the server-side). ..Qunit...
Usage and Examples
QUnit uses a set of top-level functions to provide semantic meaning in unit tests:module(string)
- defines a moduletest(string, function)
- defines a testok(boolean, string)
- validates to true or falseequal(value1, value2, message)
- compares two valuesexpect(any)
- defines a value to expect from a test
test("a basic test example", function() { ok( true, "this test is fine" ); var value = "hello"; equal( value, "hello", "We expect value to be hello" ); });
Download A sample MVC 4 Application Which uses Knockoutjs and Qunit to demonstrate MVVM.
No comments:
Post a Comment