Reputation: 477
I try to write electron app with electron-prebuilt-compile package. I installed it follow the instructions, so in my devDependencies there is not electron package. Instead of this I have electron-prebuild-compile dependency. I have a problem with my code during writing unit tests with mocha + spectron. I have module with function:
openLinkinExternalWindow( e ) {
shell.openExternal(this.link);
}
and I make shell import in front of module:
import { shell } from 'electron';
It works during application runtime, but if I want to test this module, there is an error:
Cannot find module 'electron'
What should I do to avoid this problem?
Upvotes: 2
Views: 644
Reputation: 477
I' ve used electron-mocha package instead of mocha and it works
Upvotes: 3