I have a React project running with React and React DOM version 18. I am also using Cypress for component testing and styled components for styles.
What I have been facing is that every time I run yarn upgrade
it upgrades some dependencies in the lock file, I don’t see anything in the package.json
either. Is that what yarn upgrade
does? Why doesn’t it update the dependencies in package.json
? Is it a good or bad practice to do?
Another problem is that, after running the yarn upgrade
I can see that my Cypress unit tests are failing with the following error:
The following error originated from your test code, not from Cypress.
> Cannot create styled-component for component: undefined.
When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.
Cypress could not associate this error to any specific test.
We dynamically generated a new test to display this failure.
Why is it so, are there any workarounds I can follow to fix the above tests failing?