# setup code
mkdir ~/tmp
cd ~/tmp
npx create-react-app my-app
cd my-app
# confirm tests pass
CI=true npm run test -- --no-cache
# move package
mv ~/tmp/my-app/node_modules/react-dom ~/tmp
# use npm link
npm link ../react-dom
# rerun tests
CI=true npm run test -- --no-cache
Tests fail with error:
FAIL src/App.test.js
● Test suite failed to run
Cannot find module 'react' from 'react-dom.development.js'
16 | 'use strict';
17 |
> 18 | var React = require('react');
| ^
19 | var _assign = require('object-assign');
20 | var checkPropTypes = require('prop-types/checkPropTypes');
21 | var scheduler = require('scheduler');
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)
at require (../react-dom/cjs/react-dom.development.js:18:13)
at Object.<anonymous> (../react-dom/cjs/react-dom.development.js:15:3)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 2.722s
Ran all test suites.