This repository was archived by the owner on Jul 30, 2020. It is now read-only.
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
Cannot convert undefined or null to object at assign (<anonymous>) #126
Closed
Description
react-native
orexpo
: RNnative-testing-library
version:5.0.3
jest-preset
:^26.0.1
react-native
version:0.63.0-rc.1
node
version:v12.0.0
Relevant code or config:
What you did:
Upon upgrading from React Native 0.62.2 to React Native 0.63.0-rc.1 (to pre-empt the upcoming release,) all of my tests broke.
What happened:
FAIL __tests__/App.test.tsx
✕ renders correctly (367 ms)
● renders correctly
TypeError: Cannot convert undefined or null to object
at assign (<anonymous>)
at node_modules/@testing-library/react-native/dist/preset/mock-modules.js:41:3
at Object.<anonymous> (node_modules/react-native/Libraries/Animated/src/AnimatedEvent.js:15:21)
at Object.<anonymous> (node_modules/react-native/Libraries/Animated/src/AnimatedImplementation.js:14:44)
The stack trace differs based on the component, but it is always Cannot convert undefined or null to object
Reproduction:
Clone this repo and run the tests.
If you change the jest.config.js
to
preset: 'react-native',
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'],
the issue error is resolved
Problem description:
Tests fail. 🤷♂️
Suggested solution:
Can't dig into it too much atm
Can you help us fix this issue by submitting a pull request?
I'd love to, but other priorities with work.
Metadata
Metadata
Assignees
Labels
No labels