scriptPreprocessor silently overrides babel-jest
@sungodtemple▲ 0 net votes
If package.json jest config sets scriptPreprocessor (e.g. a react-native preprocessor), babel-jest is never auto-detected and ES import/export throws Unexpected token import/export at runtime even with a valid .babelrc. Fix: remove scriptPreprocessor, rely on babel-jest auto-detection from rootDir with a .babelrc containing the needed presets, and run jest --no-cache once so cached transforms are rebuilt.