enzyme adapter giving ERROR in ./~/react-test-renderer/package.json
See original GitHub issueI am getting the following error trace
@ ./~/enzyme-adapter-react-16/build/ReactSixteenAdapter.js 27:15-58
25 04 2019 18:29:18.689:INFO [karma-server]: Karma v3.1.4 server started at http://0.0.0.0:9876/
25 04 2019 18:29:18.691:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
25 04 2019 18:29:18.695:INFO [launcher]: Starting browser ChromeHeadless
25 04 2019 18:29:19.197:INFO [HeadlessChrome 75.0.3738 (Mac OS X 10.14.4)]: Connected on socket dLE05r-TcFi8BxEHAAAA with id 2673721
HeadlessChrome 75.0.3738 (Mac OS X 10.14.4) ERROR
{
"message": "Uncaught Error: Cannot find module \"react-test-renderer/package.json\"\nat test/index.js:12553:180\n\nError: Cannot find module \"react-test-renderer/package.json\"\n at webpackMissingModule (test/index.js:12553:81)\n at Object.<anonymous> (test/index.js:12553:190)\n at Object.<anonymous> (test/index.js:13513:31)\n at __webpack_require__ (test/index.js:20:30)\n at Object.<anonymous> (test/index.js:12519:19)\n at __webpack_require__ (test/index.js:20:30)\n at Object.<anonymous>(test/index.js:53:28)\n at __webpack_require__ (test/index.js:20:30)\n at test/index.js:40:18\n at test/index.js:43:10",
"str": "Uncaught Error: Cannot find module \"react-test-renderer/package.json\"\nat test/index.js:12553:180\n\nError: Cannot find module \"react-test-renderer/package.json\"\n at webpackMissingModule (test/index.js:12553:81)\n at Object.<anonymous> (test/index.js:12553:190)\n at Object.<anonymous> (test/index.js:13513:31)\n at __webpack_require__ (test/index.js:20:30)\n at Object.<anonymous> (test/index.js:12519:19)\n at __webpack_require__ (test/index.js:20:30)\n at Object.<anonymous> (test/index.js:53:28)\n at __webpack_require__ (test/index.js:20:30)\n at test/index.js:40:18\n at test/index.js:43:10"
}
when I run karma start. “react”: “^16.1.0” “react-dom”: “^16.1.0” “react-test-renderer”: “^16.1.0”
I wonder if any can give us a clue on how to resolve this issue. Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Issues - GitHub
I am getting the following error trace @ . ... enzyme adapter giving ERROR in ./~/react-test-renderer/package.json #2111.
Read more >Enzyme expects an adapter to be configured - Stack Overflow
Error : TypeError: Adapter is not a constructor. I've grouped all the necessary steps in order to proper test your ReactJS component using...
Read more >Build Youtube in React 06: Snapshot testing using Jest and ...
As we are using React 16.x we install the enzyme-adapter-react-16 component. Why do we also need the react-test-renderer package?
Read more >enzyme-adapter-react-16 - npm
Enzyme is a JavaScript Testing utility for React that makes it easier to test your React Components' output. You can also manipulate, traverse, ......
Read more >Migrating from Enzyme to React Testing Library
It appears the key concern with React 18 is the async rendering feature, which would break a lot of the Enzyme library and...
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
I bypassed test/index.js. Just went for the test files directly. I followed this link https://github.com/webpack-contrib/karma-webpack and got the tests passing. @ljharb very similar idea to your suggestion above. Added the code below to my karma.config.
Hi @ljharb, I set up the pattern { pattern: ‘test/**/*.json’, included: false, served: true} but still the error above persists. However, while running karma start all dependencies are built except one
I did not spotted this earlier. I guess this causes the error in the title of this post. Thank you for your help