Jest test fails!
See original GitHub issueAll seem to work fine for me, except the test fails. After installing and Linking the module, jest throws error.
Invariant Violation: Native module cannot be null.
from the log:
at invariant (node_modules/fbjs/lib/invariant.js:42:15)
at new NativeEventEmitter (node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js:29:7)
at Object.<anonymous> (node_modules/react-native-orientation-locker/index.js:23:25)
Need help please. Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:14 (4 by maintainers)
Top Results From Across the Web
In Jest, how can I make a test fail? - Stack Overflow
Method-1. You can wrap your promise function within expect and tell jest the function should reject with the given error. If the someOperation()...
Read more >Troubleshooting - Jest
Use this guide to resolve issues with Jest. Tests are Failing and You Don't Know Why. Try using the debugging support built into...
Read more >Jest explicitly or arbitrarily force fail() a test - Code with Hugo
Output of the test run shows that if the code doens't throw, the test suite will fail, which is desired behaviour: FAIL src/fail-throws- ......
Read more >How to debug failing tests in jest - DEV Community
Quick tip for debugging failing tests with jest. If you already know why would you want to run tests with the debugger you...
Read more >Jest — Fail Early (And Stop Testing If One Test Fails)
Jest comes with a built-in feature to fail early if one test fails. This tutorial shows you how to configure Jest to bail...
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
BTW I have fixed the jest issue as you suggested, by mocking the module
This solved for me