Jest: Out of memory error

I’m running a relatively small amount of Jest tests on a medium+ instance and I intermittently get EOMEM: Out of memory errors in my pipeline. I have never seen this behavior locally, so I’m assuming it’s something in my Circle config. For what it’s worth I’m only running 50 React/Jest tests with no special command line options passed.

add --maxWorkers=2 to your jest command. This will prevent jest from accidentally spawning too many workers.

3 Likes

Cool. Thanks, @fernfernfern. That seems to work!