-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: give proper error message when err.stack is undefined #5313
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistFunctionality
Maintainability
Quality
User Experience
Internal
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
I will review this |
@@ -0,0 +1,9 @@ | |||
describe('issue-1669 undefined err.stack in beforeEach hook', () => { | |||
beforeEach(() => { | |||
cy.setCookie('foo', ' bar') |
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.
@bkucera if you merge in develop
, I believe this was fixed to err correctly and no longer causes an err.stack === undefined
, you may need to come up with a custom command to get the error you want
Also, just curious, is there a reason why is this an e2e
test and not just a normal driver test that asserts on the error using cy.on('fail', (err) => {...})
?
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.
if you catch the error in the 'fail' handler, it has not yet hit the logic that reads off .stack
I'll merge in develop, and try locally without these changes
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.
Alright, it did pass without the src changes, so I changed the test that now fails without these changes
User facing changelog
Additional details
How has the user experience changed?
When running the following spec in chrome, you used to get incorrect error message, now you get correct one:
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?