fails with typescript and react-test-renderer
See original GitHub issue TypeError: Cannot read property 'Constants' of undefined
at Video.render (node_modules/react-native-video/Video.js:210:59)
at finishClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5276:31)
at updateClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5238:10)
at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5907:14)
at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7949:12)
at workLoop (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7980:24)
at renderRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:8020:7)
at performWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:8592:22)
at performWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:8527:7)
at performSyncWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:8499:3)
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Typescript error for React test Renderer JSON not having ...
I have created an expo app with the basic typescript template as documented. Installed all the requirements needed for testing and ...
Read more >fails with typescript and react-test-renderer #1208 - GitHub
I just mocked the entire react-native-video dependency with a string so I could build a snapshot off the component with a Video inside...
Read more >Test Renderer - React
This package provides a React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM...
Read more >Why is my jest test failing in React native with typescript?
[Solved]-Why is my jest test failing in React native with typescript?-Reactjs ... The error was related a missing jest configuration in the package.json....
Read more >Setup - Testing Library
Javascript; Typescript. my-component.test.jsx. - import { render, fireEvent } from '@testing-library/react'; + import { render, fireEvent } ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I never solved it. I just mocked the entire
react-native-video
dependency with a string so I could build a snapshot off the component with a Video inside it.@ethanneff Did you only encounter this when doing snapshot tests, or also when you were running the app proper?
I ask because the Jest documentation notes that when doing snapshot tests of anything that makes use of native code, you need to mock it (like you’ve done here) because Jest can’t run native code.
Well, it doesn’t state it directly, but this is the only part of the documentation that talks about components that rely on native code.