Skip to content

Commit

Permalink
fix: update error stack traces for Cypress (#239)
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 instead of deep inside DOM Testing Library.
  • Loading branch information
NicholasBoll authored Nov 15, 2022
1 parent 1d62d1b commit e9fdfae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
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 e9fdfae

Please sign in to comment.