Skip to content

Commit

Permalink
fix: update error stack traces for Cypress
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
NicholasBoll committed Nov 15, 2022
1 parent ee34519 commit 85ab956
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -109,7 +109,7 @@ function createCommand(queryName, implementationName) {
onFail: () => {
// We want to override Cypress's normal non-existence message with @testing-library/dom's more helpful ones
if (error) {
options.error = error
options.error.message = error.message
}
},
})
Expand Down

0 comments on commit 85ab956

Please sign in to comment.