Skip to content

Commit 85ab956

Browse files
committed
fix: update error stack traces for Cypress
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.
1 parent ee34519 commit 85ab956

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)