title: stubbing process.exit with jest
body: <p>I have code that does something like</p>
  
  <pre><code> function myFunc(condition){
    if(condition){
      process.exit(ERROR_CODE)
    }
   }
  </code></pre>
  
  <p>How can I test this in Jest? Overwriting <code>exit</code> in <code>process</code> with <code>jest.fn()</code> and returning it back after the test doesn't work, since the process exits</p>