Tried out 4.0.0-next.98 today (coming from 3.4.3) in a medium-sized typescript monorepo. Our app builds and runs just fine.
Unfortunately some of our Jest tests broke. It looks like ts-jest is no longer getting used. Previously (with CRA3) we were able to specify a transform in the jest section of package.json like this:
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/ts-jest"
},
This allowed us to use TypeScript features not supported by Babel (like emitDecoratorMetadata for TypeORM).
Looking at the v3.4.1...master diff, I'm not sure what broke it. Perhaps something about Jest 26?
I will try to produce a repro repo when I can.
Repro steps in short:
npx create-react-app --template typescript my-react-app
- add a
const enum to the test (not supported by babel)
yarn test (see it fail)
- install
ts-jest and add the transform line above
yarn test (see it pass)
- update to react-scripts
4.0.0-next.98, see yarn test break again.
Example repo here: https://github.com/jrr/cra-4-ts-jest-issue
Tried out
4.0.0-next.98today (coming from3.4.3) in a medium-sized typescript monorepo. Our app builds and runs just fine.Unfortunately some of our Jest tests broke. It looks like ts-jest is no longer getting used. Previously (with CRA3) we were able to specify a transform in the
jestsection ofpackage.jsonlike this:This allowed us to use TypeScript features not supported by Babel (like
emitDecoratorMetadatafor TypeORM).Looking at the v3.4.1...master diff, I'm not sure what broke it. Perhaps something about Jest 26?
I will try to produce a repro repo when I can.Repro steps in short:
npx create-react-app --template typescript my-react-appconst enumto the test (not supported by babel)yarn test(see it fail)ts-jestand add the transform line aboveyarn test(see it pass)4.0.0-next.98, seeyarn testbreak again.Example repo here: https://github.com/jrr/cra-4-ts-jest-issue