Closed jiayihu closed 2 weeks ago
Okay after a bit of source code reading I found that TEST_RUNNER_PATH=/path-to-your-project/node_modules/react-scripts/scripts/test.js npx reassure
works.
The idea is simply that react-scripts test
works in making Jest transforming the files, so instead of using the Jest bin, we use the CRA test.js
bin.
Would you like me to add a note for it on the README?
CRA is no longer recommended by the React team, therefore I would leave this as is, with the existing workaround you've found.
Is your feature request related to a problem? Please describe. Is there any way to support Create React App + TypeScript? I know that CRA is basically abandoned nowadays but in many production apps it's still used.
When I run
npx assure
I get the Jest error because it's not transforming the test file with Babel. I'm not sure where to fix it:From what I can see, Jest is correctly configured to transform any TS file https://github.com/facebook/create-react-app/blob/0a827f69ab0d2ee3871ba9b71350031d8a81b7ae/packages/react-scripts/scripts/utils/createJestConfig.js#L42-L50
Describe the solution you'd like
npx assure
should be able to transformperf-test.ts
files with Jest as usual