Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest unit test fails when upgrading node from 14.17.0 to 20.17.0 #4120

Open
nabhonil opened this issue Sep 27, 2024 · 0 comments
Open

Jest unit test fails when upgrading node from 14.17.0 to 20.17.0 #4120

nabhonil opened this issue Sep 27, 2024 · 0 comments

Comments

@nabhonil
Copy link

hi,

We were facing a problem with out react 16 application with the node upgradation from 14.17.0 to 20.17.0. The jest test cases fails for our project with the following error:-

Cannot find module 'node:stream' from 'index.js'
at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:221:17)
at Object. (../node_modules/parse5-parser-stream/dist/cjs/index.js:4:23)

The version of jest, enzyme we are using are
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"jest": "^23.1.0",
"jest-cli": "^23.1.0",
"jest-css-modules": "^1.1.0",
"jest-enzyme": "^6.0.1",
"jest-junit": "^4.0.0",

When we applied a dev dependency with cheerio 1.0.0.rc.12 we are able to get it working without any change in the packages of our project. The solution is provided here https://stackoverflow.com/questions/78867305/jest-unit-tests-are-failing . However if we use the latest version of cheerio which is 1.0.0 then we get the same issue as that mentioned above. Hence we would like to know if the latest build of Cheerio can have the similar fix as that of 1.0.0.rc.12 because it looks like only Cheerio version rc12 is able to solve this issue. No other version of Cheerio has this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant