Skip to content

Commit

Permalink
add window.QUnit.reset()
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Apr 26, 2021
1 parent dfdfd43 commit 8dacdbd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,28 @@ extend( QUnit, {
skip: test.skip,
only: test.only,

restart() {
ProcessingQueue.finished = false;
globalStartCalled = false;
runStarted = false;

config.queue.length = 0;
config.modules.length = 0;
config.autostart = false;

[
"stats", "started", "updateRate", "filter", "depth", "current",
"pageLoaded", "timeoutHandler", "timeout", "pollution"
].forEach( ( key ) => delete config[ key ] );

const suiteReport = config.currentModule.suiteReport;

suiteReport.childSuites.length = 0;
delete suiteReport._startTime;
delete suiteReport._endTime;

config.modules.push( config.currentModule );
},
start: function( count ) {

if ( config.current ) {
Expand Down

0 comments on commit 8dacdbd

Please sign in to comment.