-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
fix: do not attempt to trim objects when printing to console #18341
Conversation
Thanks for taking the time to open a PR!
|
Good evening! My apologies for the failing Semantic Pull Request. Please can someone help me understand how to get that green again? Thank you. |
I was able to find the document on the rules for the PR title. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change requires tests, one place you could put them would be here: https://github.com/cypress-io/cypress/blob/0964ca2c7d54c747bfae639fa4bda1cd86817f08/packages/runner-shared/src/logger.spec.js#L1-L17
You can run these tests via yarn test
in packages/runner-shared
Added unit test and refactored based on suggestion. This pull request is ready for review again. Thank you! |
It looks like the ci/circleci driver-integration-tests-chrome failed. I looked at the details and it looks like it might be a connection issue. How does one execute that job again to see if they pass this time? |
After pulling in the main line the checks are now all green! |
It looks like a e2e test failed. Need guidance on how to resolve if it is an issue. Thank you. |
Going to dive into the tests that failed this weekend. |
Those look like some flaky tests we've been dealing with lately. I'll rerun. |
Thank you! It looks like you were right. |
Please let me know if there is anything else I can do in order to get this accepted and merged. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks for the contribution @cbolgiano !
…call value is stringified before trim is called.
…ramework * unified-desktop-gui: fix conflicts fix conflicts feat: create a copy when selecting a pre-existing story (#18440) feat: add configured state to TestingTypeCard (#18461) feat(app): run e2e tests (#18448) fix: frontend-shared typo on windi config feat: make the select language component (#18443) chore: Update Chrome (stable) to 94.0.4606.81 (#18411) release 8.6.0 fix: do not attempt to trim objects when printing to console (#18341) fix(driver): `cy.pause()` should not be ignored with `cypress run --headed --no-exit` (#18358) chore: release @cypress/vite-dev-server-v2.1.1 chore: release @cypress/react-v5.10.1
User facing changelog
There should no longer be a javascript console error when converting a javascript object that is not an array and not null when the logger logs a value. Fixes issue 18143.
Additional details
The issue seemed to have been caused by how lodash handles objects in https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/.internal/baseToString.js#L29. The version of the function in the 4.17.21 tag looks like this https://github.com/lodash/lodash/blob/4.17.21/dist/lodash.js#L4298. Line 4298 is what we see in the video captured in this issue.
I changed
cypress/packages/runner-shared/src/logger.js
Line 27 in 1feb668
How has the user experience changed?
Should no longer show "Cannot convert object to primitive value" in the javascript console when the logger tries to output the string value of an javascript object that is not an array and is not null.
PR Tasks