You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test fails saying: Cannot find module 'react-dom' from 'mobxreact.cjs.development.js'
Full error:
bash-3.2$ npm test
> JestMobxChecker@0.0.1 test /Users/jay.shah/Documents/sampleapps/JestMobxChecker
> jest
FAIL __tests__/App-test.js
● Test suite failed to run
Cannot find module 'react-dom' from 'mobxreact.cjs.development.js'
However, Jest was able to find:
'./ColorComponent.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
However, Jest was able to find:
'../App.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:276:11)
at Object.<anonymous> (node_modules/mobx-react/dist/mobxreact.cjs.development.js:10:16)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.401s
Ran all test suites.
npm ERR! Test failed. See above for more details.
Having a fairly barebones react-native + mobx setup here (https://github.com/jayshah123/mobx-jest-test-error)
Running
npm testasks forreact-domdependency.Intended outcome
Jest test should run as expected
Actual outcome
Test fails saying:
Cannot find module 'react-dom' from 'mobxreact.cjs.development.js'Full error:
How to reproduce the issue
https://github.com/jayshah123/mobx-jest-test-error
Versions