Ryan Lanciaux

Random programming blog.

React + Jest Testing on Windows II

Last time I wrote about running Jest on Windows there was one thing I left out. The test output would show if the tests pass or fail but no data is displayed regarding why they fail. This is due to an issue with stdio in Windows, however, there appears to be a fix in the works.

Until that fix makes its way into a released version of Jest, you can simply copy bin/jest.js from Connor Malone’s branch on GitHub as a workaround. If using the file outright doesn’t sound desirable, any line that has process.exit(0) can be wrapped in a process.on('exit') block:

process.on('exit', function(){

See the diff of the modified code here.