diff --git a/core/test/scripts/run-mocha-tests.js b/core/test/scripts/run-mocha-tests.js index eb237a07567f..09af9b8c9232 100644 --- a/core/test/scripts/run-mocha-tests.js +++ b/core/test/scripts/run-mocha-tests.js @@ -146,6 +146,9 @@ const rawArgv = y 'require': { type: 'string', }, + 'retries': { + type: 'number', + }, }) .wrap(y.terminalWidth()) .argv; @@ -259,6 +262,7 @@ function exit({numberFailures, numberMochaInvocations}) { * @property {boolean} bail * @property {boolean} parallel * @property {string | undefined} require + * @property {number | undefined} retries */ /** @@ -281,6 +285,7 @@ async function runMocha(tests, mochaArgs, invocationNumber) { // TODO: not working // parallel: tests.length > 1 && mochaArgs.parallel, parallel: false, + retries: mochaArgs.retries, }); // @ts-expect-error - not in types. @@ -325,6 +330,7 @@ async function main() { bail: argv.bail, parallel: argv.parallel, require: argv.require, + retries: argv.retries, }; mochaGlobalSetup(); diff --git a/package.json b/package.json index ba80efafba03..5135f65742ce 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "unit-viewer": "yarn mocha --testMatch viewer/**/*-test.js", "unit-flow": "bash flow-report/test/run-flow-report-tests.sh", "unit": "yarn unit-flow && yarn mocha", - "unit:ci": "NODE_OPTIONS=--max-old-space-size=8192 npm run unit --forbid-only", + "unit:ci": "NODE_OPTIONS=--max-old-space-size=8192 npm run unit --forbid-only --retries=5", "core-unit": "yarn unit-core", "cli-unit": "yarn unit-cli", "viewer-unit": "yarn unit-viewer",