Closed IanVS closed 8 months ago
Hi @IanVS, sorry it took us time to get to this.
You can override the getElementError
in the config to remove that.
I believe something like this should work:
getElementError(message, container) {
const error = new Error(
[
message,
`Ignored nodes: comments, ${config.defaultIgnore}\n`,
]
.filter(Boolean)
.join('\n\n'),
)
error.name = 'TestingLibraryElementError'
return error
}
Thanks for pointing me in the right direction!
Describe the feature you'd like:
I am using this tool within Storybook, which means that it's not important for me to have a dump of the DOM output to the console every time a test fails, I can see the HTML as rendered in the page. And by having a long, long dump in the logs, it makes the test results when I run in CI more difficult to skim and find the actual error messages.
Suggested implementation:
Perhaps an option could be added to the configuration, which defaults to the current behavior, but allows turning off the DOM dump?
Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy: