workaround for windows to ensure console.log is always flushed before pr...

...ocess.exit

This is a potential solution for https://github.com/facebook/jest/issues/110

I don't have much experience with Node yet so I might be missing something here, but it at least fixed my problem and am now seeing all test results logged to console.


Interesting, hadn't heard of this before...but seems to be a KP: https://www.npmjs.org/package/exit

One thing we need to be sure of on these changes is that execution doesn't continue after exiting (which was part of the intent of those exits before). So we either need to refactor the scripts so they can return early after setting up this listener, or find a way to make sure that the remaining code doesn't continue to execute if we hit this branch in the code path.