QUnit.onUncaughtException()

version added: 2.17.0

Description

QUnit.onUncaughtException( error )

Handle a global error that should result in a failed test run.

name description
error (any) Usually an Error object, but any other thrown or rejected value may be given as well.

Examples

const error = new Error( "Failed to reverse the polarity of the neutron flow" );
QUnit.onUncaughtException( error );
process.on( "uncaughtException", QUnit.onUncaughtException );
window.addEventListener( "unhandledrejection", function( event ) {
  QUnit.onUncaughtException( event.reason );
} );