-
Notifications
You must be signed in to change notification settings - Fork 154
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
cypress cannot find the line number of failed .findBy commands #232
Closed
rmmanseau opened this issue
Oct 14, 2022
· 3 comments
· Fixed by #239 · May be fixed by turnmodz/suquinnff#22 or turnmodz/suquinnff#23
Closed
cypress cannot find the line number of failed .findBy commands #232
rmmanseau opened this issue
Oct 14, 2022
· 3 comments
· Fixed by #239 · May be fixed by turnmodz/suquinnff#22 or turnmodz/suquinnff#23
Labels
Comments
I can look into this. This plugin takes the error created by DOM Testing Library to give more context to the error, but the stack trace isn't useful. Perhaps we can merge the message from DOM Testing Library and leave the rest of the assertion error alone. |
NicholasBoll
added a commit
that referenced
this issue
Nov 15, 2022
Fixes #232 Update the Cypress error message rather than the entire error object. This merges the useful message of DOM Testing Library with the useful context of the Cypress error. This allows Cypress to find the line number of the failure in spec files i nstead of deep inside DOM Testing Library.
NicholasBoll
added a commit
that referenced
this issue
Nov 15, 2022
Fixes #232 Update the Cypress error message rather than the entire error object. This merges the useful message of DOM Testing Library with the useful context of the Cypress error. This allows Cypress to find the line number of the failure in spec files instead of deep inside DOM Testing Library.
🎉 This issue has been resolved in version 8.0.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
first, to address this:
the getBy functions do work properly, but when they fail cypress is not able to figure out where the failure is coming from & point to it accurately. This makes for difficult debugging because it's not possible to immediately jump to the failed testing library commands. I believe that this issue does belong here, as the issue is specific to integration with cypress test runner.
cypress-testing-library
version: 8.0.3cypress
version: 10.10.0node
version: 14.20npm
(oryarn
) version: 1.22.19Relevant code or config
What you did:
run a test that fails on a cy.findBy* command
What happened:
it creates a
TestingLibraryElementError
and dumps the entire state of the DOMWhat I expected:
it generates an
Assertion Error
and points to the line of the failing assertion.Reproduction repository: https://github.com/rmmanseau/cy-testing-library-repro
Problem description:
@testing-library/cypress doesn't generate the correct assertion type / stack trace / whatever is required by cypress in order for it to point to the location of the failing line.
Suggested solution:
do the thing that cypress expects.
The text was updated successfully, but these errors were encountered: