Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ function collect(browserNames) {
testRunner.focusMatchingTests(new RegExp(filter, 'i'));
}

const repeatArgIndex = process.argv.indexOf('--repeat');
if (repeatArgIndex !== -1) {
const repeat = parseInt(process.argv[repeatArgIndex + 1], 10);
if (!isNaN(repeat))
testRunner.repeatAll(repeat);
}

return testRunner;
}

Expand Down
5 changes: 5 additions & 0 deletions utils/testrunner/TestCollector.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class TestCollector {
this._api = {};

this._currentSuite = new Suite(null, '', new Location());
this._rootSuite = this._currentSuite;

this._api.describe = specBuilder(this._suiteModifiers, this._suiteAttributes, (specs, name, suiteCallback, ...suiteArgs) => {
const location = Location.getCallerLocation();
Expand Down Expand Up @@ -223,6 +224,10 @@ class TestCollector {
suites() {
return this._suites;
}

rootSuite() {
return this._rootSuite;
}
}

module.exports = { TestCollector, specBuilder, FocusedFilter, Repeater };
4 changes: 4 additions & 0 deletions utils/testrunner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ class DefaultTestRunner {
}
}

repeatAll(repeatCount) {
this._repeater.repeat(this._collector.rootSuite(), repeatCount);
}

async run() {
let reporter = null;

Expand Down