After trying many things, running it with npm test -- --runInBand or jest --runInBand fixed it. I'm gonna read the docs about it. It seems it also makes it faster
npm test -- --runInBand
jest --runInBand