mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
test: add some environment variables for controlling tests (#39364)
chore: add some environment variables for controlling tests Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
This commit is contained in:
@@ -13,6 +13,11 @@ process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true';
|
||||
|
||||
const { app, protocol } = require('electron');
|
||||
|
||||
// Some Linux machines have broken hardware acceleration support.
|
||||
if (process.env.ELECTRON_TEST_DISABLE_HARDWARE_ACCELERATION) {
|
||||
app.disableHardwareAcceleration();
|
||||
}
|
||||
|
||||
v8.setFlagsFromString('--expose_gc');
|
||||
app.commandLine.appendSwitch('js-flags', '--expose_gc');
|
||||
// Prevent the spec runner quitting when the first window closes
|
||||
@@ -68,6 +73,14 @@ app.whenReady().then(async () => {
|
||||
reporterEnabled: process.env.MOCHA_MULTI_REPORTERS
|
||||
};
|
||||
}
|
||||
// The MOCHA_GREP and MOCHA_INVERT are used in some vendor builds for sharding
|
||||
// tests.
|
||||
if (process.env.MOCHA_GREP) {
|
||||
mochaOptions.grep = process.env.MOCHA_GREP;
|
||||
}
|
||||
if (process.env.MOCHA_INVERT) {
|
||||
mochaOptions.invert = process.env.MOCHA_INVERT === 'true';
|
||||
}
|
||||
const mocha = new Mocha(mochaOptions);
|
||||
|
||||
// The cleanup method is registered this way rather than through an
|
||||
|
||||
Reference in New Issue
Block a user