Skip to content

Commit e9fdfae

Browse files
authored
fix: update error stack traces for Cypress (#239)
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.
1 parent 1d62d1b commit e9fdfae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function createCommand(queryName, implementationName) {
109109
onFail: () => {
110110
// We want to override Cypress's normal non-existence message with @testing-library/dom's more helpful ones
111111
if (error) {
112-
options.error = error
112+
options.error.message = error.message
113113
}
114114
},
115115
})

0 commit comments

Comments
 (0)