node.js - Runtime Error occurs when require('electron') with Jest test file -


when import 'electron' , run jest, following error occurs. using require or import don't matter. , jest.automockoff() doesn't also.

 fail  __tests__/root_test.js ● runtime error typeerror: cannot read property 'on' of undefined 

versions follows.

  • node: v4.2.1
  • jest-cli: v0.8.2
  • electron-prebuilt: v0.36.4

can me?

if tests load built-in electron modules have run them within electron process, built-in electron modules not available in regular node process (which if run jest commandline).


Comments