Skip to content

Commit

Permalink
Exploring disconnect between launch time and read time with Karma
Browse files Browse the repository at this point in the history
  • Loading branch information
twolfson committed Jun 18, 2019
1 parent 3ee7946 commit ae93d14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/electron-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ if (program.require) {
async.parallel([
function loadExtendedOptions (cb) {
// If we have extended options, then load them in
console.log('hiii', program.extendedOptions);
if (program.extendedOptions) {
fs.readFile(program.extendedOptions, function handleReadFile (err, extendedOptionsStr) {
console.log('hiii', err, program.extendedOptionsStr);
// If we have an error, callback with it
if (err) { return cb(err); }

Expand Down
6 changes: 4 additions & 2 deletions lib/karma-electron-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function ElectronBrowser(baseBrowserDecorator, args, karmaBasePath, karmaUrlRoot
// https://github.com/electron/electron/issues/4218
// DEV: We write options out now as `_getOptions` is re-run on every start (e.g. crash occurs)
var extendedOptions;
var extendedOptionsFilepath = path.join(this._tempDir, 'karma-electron-options.json');
if (args.browserWindowOptions) {
extendedOptions = extendedOptions || {};
extendedOptions.browserWindowOptions = args.browserWindowOptions;
Expand All @@ -59,7 +58,10 @@ function ElectronBrowser(baseBrowserDecorator, args, karmaBasePath, karmaUrlRoot
// Use temporary directory provided by karma
// https://github.com/karma-runner/karma/blob/v4.1.0/lib/launchers/process.js#L15
// DEV: File will automatically be removed by Karma which is nice
fs.writeFileSync(extendedOptionsFilepath, JSON.stringify(extendedOptions), 'utf8');
var extendedOptionsFilepath = path.join(this._tempDir, 'karma-electron-options.json');
console.log('wtf', fs.writeFileSync + '');
fs.writeFileSync(extendedOptionsFilepath, JSON.stringify(extendedOptions));
console.log('aaa', fs.readFileSync(extendedOptionsFilepath).toString('utf8'));
retArr = retArr.concat(['--extended-options', extendedOptionsFilepath]);
}
return retArr;
Expand Down

0 comments on commit ae93d14

Please sign in to comment.