Expose require to Spectron if running smoke test.

This commit is contained in:
Michel Kaporin 2017-06-15 12:52:54 +02:00
parent c80efd221b
commit 4779453977
2 changed files with 5 additions and 0 deletions

View file

@ -12,6 +12,10 @@ if (window.location.search.indexOf('prof-startup') >= 0) {
profiler.startProfiling('renderer', true);
}
if (process.env.SMOKE_TEST) {
window.electronRequire = require; // if smoke test, expose require to Spectron to access the core Electron APIs
}
/*global window,document,define*/
const startTimer = require('../../../base/node/startupTimers').startTimer;

View file

@ -42,6 +42,7 @@ if (parseInt(process.version.substr(1)) < 6) {
}
// Setting up environment variables
process.env.SMOKE_TEST = 'true';
process.env.VSCODE_LATEST_PATH = program.latest;
if (program.stable) process.env.VSCODE_STABLE_PATH = program.stable;
process.env.SMOKETEST_REPO = testRepoLocalDir;