test: support for adding extra module paths (#26490)

This commit is contained in:
David Sanders 2020-11-17 12:05:10 -08:00 committed by GitHub
parent 023c89265f
commit 2b4ce387bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -4,6 +4,13 @@ const v8 = require('v8');
Module.globalPaths.push(path.resolve(__dirname, '../spec/node_modules'));
// Extra module paths which can be used to load Mocha reporters
if (process.env.ELECTRON_TEST_EXTRA_MODULE_PATHS) {
for (const modulePath of process.env.ELECTRON_TEST_EXTRA_MODULE_PATHS.split(':')) {
Module.globalPaths.push(modulePath);
}
}
// We want to terminate on errors, not throw up a dialog
process.on('uncaughtException', (err) => {
console.error('Unhandled exception in main spec runner:', err);