React Jest test fails to run with ts-jest - Encountered an unexpected token on imported file
- 阅读更多 关于 React Jest test fails to run with ts-jest - Encountered an unexpected token on imported file
问题 I'm new to testing React/Typescript apps. I want to unit test my React components, because I'm not satisfied to develop apps without tests at all. The app itself works fine, it's just failing to run in test mode. command (alias for react-scripts test ): yarn test output: FAIL src/containers/pages/Feature/Feature.test.tsx ● Test suite failed to run Jest encountered an unexpected token This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain