title: Run jest with electron instead of node
body: <p>To make a long story short, I'd like to run my jest tests (using CLI) with electron instead of node.</p>
  
  <p>It's relevant when using native module, because you need to build them using electron header while jest run them using plain node. 
  So I must either build my native modules for my app (at least in dev mode) or my tests, I can't have both to work. </p>
  
  <p><a href="https://discuss.atom.io/t/how-to-test-native-modules/18792" rel="noreferrer">In this thread</a> they propose to use mocha, but I want to use jest, which is far more advanced and interact well with React.
  Note that I don't want to mock the native module, since I write integration tests.</p>
  
  <p>I opened an issue about the <a href="https://github.com/zeromq/zeromq.js/issues/144" rel="noreferrer">zmq github repo</a>. One proposed solution is "to target your tests using ELECTRON_RUN_AS_NODE=true electron as your node runtime".
  This is a very good solution, since using electron will both make the test environment closer to the execution environment and solve my specific issue with native modules.</p>
  
  <p>I'd like to apply that, but I do no seem to be able to setup the jest CLI to use electron instead of node, and I have no idea where to start. Maybe I should run jest programmatically without the CLI ? But I might lose the nice test filtering features of the CLI.</p>
  
  <p>Has anyone solved this already?</p>