Skip to content

Commit

Permalink
fix(windows): electron window not displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltan-mihalyi committed Jan 8, 2021
1 parent 60a8cf1 commit e0c7f3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/run.js
Expand Up @@ -29,7 +29,7 @@ module.exports.run = function (args = {}) {
path.join(this.locations.www, 'cdv-electron-main.js')
);

const child = execa(electron, electonArgs);
const child = execa(electron, electonArgs, { windowsHide: false });

child.on('close', (code) => {
process.exit(code);
Expand Down
5 changes: 3 additions & 2 deletions tests/spec/unit/lib/run.spec.js
Expand Up @@ -27,6 +27,7 @@ const apiStub = Object.freeze({
});

const expectedPathToMain = path.join(apiStub.locations.www, 'cdv-electron-main.js');
const expectedExecaOptions = { windowsHide: false };

const run = rewire(path.join(rootDir, 'lib/run'));

Expand All @@ -45,7 +46,7 @@ describe('Run', () => {

run.run.call(apiStub);

expect(execaSpy).toHaveBeenCalledWith('electron-require', [expectedPathToMain]);
expect(execaSpy).toHaveBeenCalledWith('electron-require', [expectedPathToMain], expectedExecaOptions);
expect(onSpy).toHaveBeenCalled();
expect(process.exit).not.toHaveBeenCalled();

Expand All @@ -71,7 +72,7 @@ describe('Run', () => {

run.run.call(apiStub, { argv: ['--inspect-brk=5858'] });

expect(execaSpy).toHaveBeenCalledWith('electron-require', expectedElectronArguments);
expect(execaSpy).toHaveBeenCalledWith('electron-require', expectedElectronArguments, expectedExecaOptions);
expect(onSpy).toHaveBeenCalled();
expect(process.exit).not.toHaveBeenCalled();

Expand Down

0 comments on commit e0c7f3c

Please sign in to comment.