QUnit.done()


QUnit.done( callback )

Description: Register a callback to fire whenever the test suite ends.

  • QUnit.done( callback )

    • callback
      Type: Function( Object details )
      Callback to execute. Provides a single argument with the following properties:
      • failed
        Type: Number
        The number of failed assertions
      • passed
        Type: Number
        The number of passed assertions
      • total
        Type: Number
        The total number of assertions
      • runtime
        Type: Number
        The time in milliseconds it took tests to run from start to finish.

Example:

Register a callback that logs test results to the console.

1
2
3
QUnit.done(function( details ) {
console.log( "Total: ", details.total, " Failed: ", details.failed, " Passed: ", details.passed, " Runtime: ", details.runtime );
});