build: only retry tests on CI (#37167)

This commit is contained in:
Samuel Attard 2023-02-07 22:44:53 -08:00 committed by GitHub
parent 9a0a0a7a46
commit 00a542358d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,9 +50,11 @@ app.whenReady().then(async () => {
const Mocha = require('mocha'); const Mocha = require('mocha');
const mochaOptions = { const mochaOptions = {
retries: 3,
forbidOnly: process.env.CI forbidOnly: process.env.CI
}; };
if (process.env.CI) {
mochaOptions.retries = 3;
}
if (process.env.MOCHA_REPORTER) { if (process.env.MOCHA_REPORTER) {
mochaOptions.reporter = process.env.MOCHA_REPORTER; mochaOptions.reporter = process.env.MOCHA_REPORTER;
} }