-
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
Failed cy.exec should log full error #5470
Comments
Example code: cy.exec('(yes "Very long output" | head -n 100) && false') |
Workaround: const exec = command => {
cy.exec(command, { failOnNonZeroExit: false }).then(result => {
if (result.code) {
throw new Error(`Execution of "${command}" failed
Exit code: ${result.code}
Stdout:\n${result.stdout}
Stderr:\n${result.stderr}`);
}
})
}
exec('(yes "Very long output" | head -n 100) && false') |
Thanks for this workaround that works like a charm. |
+1 on this |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
This issue has been closed due to inactivity. |
Here's some activity. Still relevant! |
Current behavior:
When calling a command that fails with
cy.exec
, the stderr output is truncated:Desired behavior:
Cypress should log the full stderr output to allow debugging of the issue:
Steps to reproduce: (app code and test code)
Call
cy.exec
with a command that fails with a long error (e.g. stack trace).Versions
Cypress 3.4.1
The text was updated successfully, but these errors were encountered: