Guest User

Untitled

a guest
Jan 16th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. ```bash
  2. # setup code
  3. mkdir ~/tmp
  4. cd ~/tmp
  5. npx create-react-app my-app
  6. cd my-app
  7.  
  8. # confirm tests pass
  9. CI=true npm run test -- --no-cache
  10.  
  11. # move package
  12. mv ~/tmp/my-app/node_modules/react-dom ~/tmp
  13.  
  14. # use npm link
  15. npm link ../react-dom
  16.  
  17. # rerun tests
  18. CI=true npm run test -- --no-cache
  19. ```
  20. Tests fail with error:
  21. ```bash
  22. FAIL src/App.test.js
  23. ● Test suite failed to run
  24.  
  25. Cannot find module 'react' from 'react-dom.development.js'
  26.  
  27. 16 | 'use strict';
  28. 17 |
  29. > 18 | var React = require('react');
  30. | ^
  31. 19 | var _assign = require('object-assign');
  32. 20 | var checkPropTypes = require('prop-types/checkPropTypes');
  33. 21 | var scheduler = require('scheduler');
  34.  
  35. at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)
  36. at require (../react-dom/cjs/react-dom.development.js:18:13)
  37. at Object.<anonymous> (../react-dom/cjs/react-dom.development.js:15:3)
  38.  
  39. Test Suites: 1 failed, 1 total
  40. Tests: 0 total
  41. Snapshots: 0 total
  42. Time: 2.722s
  43. Ran all test suites.
  44. ```
Add Comment
Please, Sign In to add comment