Open matheusgoc opened 2 years ago
I have an example here https://github.com/ahnpnl/react-native-ts-jest-example
It’s old one but working at that time
@ahnpnl Just did some experiments with the working example integrated with react native. It works on v 26 for jest and ts-jest. v27 of both libraries failed on the same test. Also, it's strange that in tsconfig.spec.json, the value for "jsx" must be "react", whereas in the regular tsconfig.json it is "react-native". Setting the spec file to jsx: "react-native" will also fail the test.
Version
^27.1.4
Steps to reproduce
See page https://kulshekhar.github.io/ts-jest/docs/guides/react-native#jest-config
Expected behavior
The Jest Config placed at https://kulshekhar.github.io/ts-jest/docs/guides/react-native#jest-config seems to be wrong because
tsjPreset
has no use. I suppose it would extend the configuration as pointed out on this post Typescript React Native with JestActual behavior
tsjPreset
has no use at the documentation code. Consider either take it out or update to a better solution.Debug log
just documentation to be updated
Additional context
Based on the documentation, I still don't know how to properly set up
ts-jest
to be used with react native. I'm actually trying to use it with react native testing library but did not get any real solution for it facing a bunch of issues on the way. I've post this a question (https://stackoverflow.com/questions/71800362/react-native-testing-library-with-typescript-does-not-work) at stack overflow about the problem I'm facing with it, but clearly the documentations lacks on react native set up. I appreciate for any help!Environment