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 21, 2021
1 parent 241b565 commit 3ec3b24
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ 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]);

let 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 3ec3b24

Please sign in to comment.