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

Upgrade from version 3 to 5 is breaking all my tests #1733

Closed
simkessy opened this issue Feb 17, 2022 · 5 comments
Closed

Upgrade from version 3 to 5 is breaking all my tests #1733

simkessy opened this issue Feb 17, 2022 · 5 comments

Comments

@simkessy
Copy link

Current behaviour 💣

I've upgraded from version 3 to 5 and it's breaking all my tests

image

image

 TypeError: Cannot read property 'Tag' of undefined

      at Object.<anonymous> (../../../node_modules/domhandler/lib/node.js:32:35)
      at Object.<anonymous> (../../../node_modules/domhandler/lib/index.js:15:14)
      at Object.<anonymous> (../../../node_modules/htmlparser2/lib/index.js:2:18)
      at Object.<anonymous> (../../../node_modules/cheerio/lib/parse.js:4:18)
      at Object.<anonymous> (../../../node_modules/cheerio/lib/cheerio.js:5:13)
      at Object.<anonymous> (../../../node_modules/cheerio/index.js:5:28)
      at Object.<anonymous> (../../../node_modules/enzyme/src/Utils.js:9:1)
      at Object.<anonymous> (../../../node_modules/enzyme/src/ShallowWrapper.js:5:1)
      at Object.<anonymous> (../../../node_modules/enzyme-to-json/utils.js:12:46)
      at Object.<anonymous> (../../../node_modules/enzyme-to-json/createSerializer.js:8:14)
      at Object.<anonymous> (../../../node_modules/enzyme-to-json/serializer.js:3:48)
          at Array.forEach (<anonymous>)

Expected behaviour ☀️

I haven't changed anything in my tests, I need this library for webpack to build my html pages but updating this library ends up breaking all my tests. Expected behaviour would be for it not to break everything

Environment 🖥

Node.js v14.17.1
linux 5.4.0-1041-aws
6.14.13
@services/myApp@3.27.0 /home/ksimilien/code/pinboard/services/pq3/client
└── (empty)

(.venv) ~/code/pinboard/services/pq3/client$ npm ls html-webpack-plugin
@services/myApp@3.27.0 /home/ksimilien/code/pinboard/services/pq3/client
└── (empty)

"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"enzyme-to-json": "^3.4.4",
@jantimon
Copy link
Owner

The code from 3 to 4 and 4 to 5 introduced breaking changes.

That's why the major version has increased.

@simkessy
Copy link
Author

@jantimon what packages or how do I fix it, I don't see how those breaking changes in this package interact with my Jest / Enzyme tests.

@jantimon
Copy link
Owner

hard to say - depends on:

  • node version
  • webpack version
  • webpack config
  • other webpack plugins

@simkessy
Copy link
Author

@jantimon

Node.js v14.17.1
"webpack": "^5.69.0",
I don't use webpack config for running tests so I don't think it's relevant

Seems like others have had this issue https://stackoverflow.com/questions/68303360/cannot-read-property-tag-of-undefined-from-domhandler-in-react-js-app

@jantimon
Copy link
Owner

sorry i have never had this problem before and would need to debug it by myself

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

No branches or pull requests

2 participants