Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.18 KB

QUnit.moduleDone.md

File metadata and controls

41 lines (32 loc) · 1.18 KB
layout title excerpt groups redirect_from version_added
page-api
QUnit.moduleDone()
Register a callback to fire whenever a module ends.
callbacks
/callbacks/QUnit.moduleDone/
/QUnit.moduleDone/
1.0.0

QUnit.moduleDone( callback )

Register a callback to fire whenever a module ends. The callback may be an async function, or a function that return a promise which will be waited for before the next callback is handled.

parameter description
callback (function) Callback to execute. Provides a single argument with the callback Details object

Details object

Passed to the callback:

property description
name (string) Name of this module
failed (number) The number of failed assertions
passed (number) The number of passed assertions
total (number) The total number of assertions
runtime (number) The execution time in milliseconds of this module

Examples

Register a callback that logs the module results

QUnit.moduleDone(details => {
  console.log(`Finished running: ${details.name} Failed/total: ${details.failed}/${details.total}`);
});