QUnit.todo()


QUnit.todo( name, callback )

Description: Adds a test which expects at least one failing assertion during its run.

Use this method to test a unit of code which is still under development (in a "todo" state). The test will pass as long as one failing assertion is present. If all assertions pass, then the test will fail signaling that QUnit.todo should be replaced by QUnit.test.

Example:

How to use QUnit.todo to denote code that is still under development.

1
2
3
4
5
6
7
8
9
10
11
QUnit.module( "robot", {
beforeEach: function() {
this.robot = new Robot();
}
});
// fireLazer hasn't been properly implemented yet, so this is a todo test
QUnit.todo( "fireLazer returns the correct value", function( assert ) {
var result = this.robot.fireLazer(); // Currently returns undefined
assert.equal( result, "I'm firing my lazer!" );
});