How to resolve “Cannot use import statement outside a module” from Jest when running tests?
I was having the same failure (also using Babel, Typescript and Jest), it was driving me crazy for hours! Ended up creating a new babel.config.js file specifically for the tests. I had a large .babelrc that wasn’t getting picked up by jest no matter what I did to it. The main app still uses the … Read more