After updating CRA to version 5.
When running npm test
I see the following error:
Determining test suites to run...
● Test suite failed to run
TypeError: babelJest.createTransformer is not a function
at Object.<anonymous> (node_modules/react-app-rewired/scripts/utils/babelTransform.js:16:28)
at node_modules/@jest/transform/build/ScriptTransformer.js:382:73
at Array.map (<anonymous>)
I've checked and there is a fix for babel-jest addressing this issue:
https://github.com/facebook/jest/issues/11444 and it was released on version 28
CRA depends on version ^27.4.2
.
Has anyone faced this or have an idea on a proper solution that does not involve overriding the babel-jest version specified in CRA?