Just try use react-native@0.61.5 with the native-testing-library@6.0.0
What happened:
$ jest
FAIL src/components/ui/Button/__tests__/Button.test.tsx
● Test suite failed to run
Cannot find module 'react-native/Libraries/LogBox/LogBox' from 'node_modules/@testing-library/react-native/dist/preset/mock-modules.js'
Require stack:
node_modules/@testing-library/react-native/dist/preset/mock-modules.js
node_modules/@testing-library/react-native/dist/preset/setup.js
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:308:11)
at Object.<anonymous> (node_modules/@testing-library/react-native/dist/preset/mock-modules.js:79:6)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.31 s, estimated 2 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Reproduction:
Setup react-native@0.61.5 with native-testing-library@6.0.0
Problem description:
The runner don't works with the defaults mock-modules from @testing-library/react-native mock_modules,
Suggested solution:
mock-modules try to mock the LogBox, I think a conditionally check if the file exists resolve the problem
react-native
orexpo
: react-nativenative-testing-library
version: 6.0.0jest-preset
: @testing-library/react-nativereact-native
version: 0.61.5node
version: 12.16.0What you did:
Just try use react-native@0.61.5 with the native-testing-library@6.0.0
What happened:
Reproduction:
Problem description:
Suggested solution:
LogBox
, I think a conditionally check if the file exists resolve the problem