-
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: issue-7715 #23575
fix: issue-7715 #23575
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
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 |
expect(result.stack).to.equal('replaced stack') | ||
}) | ||
|
||
it('attaches source mapped stack', () => { |
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.
Deleted this test since we're no longer attaching the property sourceMappedStack
cypress run
is different from the stack trace incypress open
#7715User facing changelog
In the terminal, users will now see the source map line and column number in the error stack trace. Fixes #7715
Additional details
Previously, we were finding the stack trace with the source map -- but we weren't doing anything with it 😱 it was appended to the error as
error.sourceMappedStack
and left to linger, perhaps for debugging purposes.This PR reassigns the
stack
property to the value of the source mapped stack and removes the lone propertysourceMappedStack
.The purists among us may say,
To which I will answer,
Steps to test
packages/driver/cypress/e2e/commands/agents.cy.js
cd packages/runner && yarn watch
yarn cypress:run --headed --project packages/driver --spec packages/driver/cypress/e2e/commands/agents.cy.js --browser chrome --no-exit
For example, all three of these show line 8, column 25:
cypress/e2e/commands/agents.cy.js:8:25
How has the user experience changed?
Now we see the correct line number/column in the stack trace. Note: you'll notice the stack trace link has changed from
http://localhost:3500/__cypress/tests?p=cypress/e2e/commands/agents.cy.js:X:XX
towebpack:///./cypress/e2e/commands/agents.cy.js:X:XX
, but this has no impact on the user experience since the localhost domain was not relevant to the user's source map in the codebase. In fact, we may be interested in stripping it as we do in the CodeFrame source map lineBefore:
After:
PR Tasks
cypress-documentation
?type definitions
?