QUnit.moduleDone()


QUnit.moduleDone( callback )

Description: Register a callback to fire whenever a module ends.

  • QUnit.moduleDone( callback )

    • callback
      Type: Function( Object details )
      Callback to execute. Provides a single argument with the following properties:
      • name
        Type: String
        Name of this module
      • 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 total runtime in millseconds of this module

Example:

Register a callback that logs the module results

1
2
3
QUnit.moduleDone(function( details ) {
console.log( "Finished running: ", details.name, "Failed/total: ", details.failed, details.total );
});