Jest tests are broken: Error: Cannot find module './datepicker' from 'index.js'
See original GitHub issueVersion
Tell us which versions you are using:
- tcomb-form-native v0.4.0
- react-native v0.22.2
Expected behaviour
Tests should pass as they used to!
Actual behaviour
Error: Cannot find module ‘./datepicker’ from ‘index.js’
Steps to reproduce
- git clone git@github.com:bartonhammond/snowflake.git
- npm3 install
- npm3 test
✓ it if disabled and not checked, it should display square-o and text
FAIL src/components/__tests__/LoginForm-test.js
Runtime Error
Error: Cannot find module './datepicker' from 'index.js'
at Loader._resolveNodeModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:431:11)
at Object.<anonymous> (/Users/barton/projects/MFV/snowflake/node_modules/tcomb-form-native/lib/templates/bootstrap/index.js:5:12)
at Object.<anonymous> (/Users/barton/projects/MFV/snowflake/node_modules/tcomb-form-native/index.js:3:15)
1 test suite failed, 74 tests passed (74 total in 11 test suites, run time 7.245s)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:23 (10 by maintainers)
Top Results From Across the Web
Jest test runs - Cannot find module error - Stack Overflow
Your implementation looks right. But it looks like the option moduleNameWrapper was the wrong option, it's supposed to be moduleNameMapper .
Read more >react-datepicker - npm
A simple and reusable datepicker component for React. Latest version: 4.8.0, last published: 7 months ago. Start using react-datepicker in ...
Read more >Troubleshooting - Jest
Troubleshooting. Uh oh, something went wrong? Use this guide to resolve issues with Jest. Tests are Failing and You Don't Know Why.
Read more >cannot find module 'elasticsearch' from 'setup-jest.js' - You.com
I'm trying to downgrade "@elastic/elasticsearch" to from "8.4.2" to version "7.6.0", but the app is not able to start, and seem the listEntities...
Read more >[Solved]-jest.mock - Cannot find module in React test file-Reactjs
[Solved]-jest.mock - Cannot find module in React test file-Reactjs. Search. score:0. if (!window.BroadcastChannel) window.
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 FreeTop 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
Top GitHub Comments
The following seems to work w/ JEST testing!
Here is the full
package.json
wrt Jest setup:Would you like a PR w/ a note in the README?
@bartonhammond I’ve opened a SO question about this http://stackoverflow.com/questions/36479136/test-platform-specific-extension-code-for-react-native
Have you managed to test platform-specific code under
snowflake
?