You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pretty-dom + getElementError error that Testing Library outputs is super long for the e2e use case since we're working with entire pages instead of small units. So far, we're thinking of addressing this with either or both of the following:
Modify the default getElementError to better suit our use case (strip <style /> + <script />? — see last comment below for details/ideas)
Support the getElementError configuration option from Testing Library
One other thing -- is there any way that we could allow users to configure getElementError? I'm finding the length of the error messages incredibly long as it prints out a bunch of HTML and CSS and I have to scroll up a long way to find the actual error message.
Okay, so this is something I've wanted to address since I created this library. I'd be curious if you have an idea of what a better default implementation/output would be. I do think we can add support for this option, but I really think we also need a better default because the e2e use case just always produces so much output. I also want to figure out how to preserve the ANSI formatting in the Testing Library errors.
I agree that we might want to change the default getElementError and have a few suggestions.
It outputs huge amounts of inline CSS/HTML in our case. This seems to be because of pretty-dom which sets a length limit of 7000 by default (!!!). My recommendation would be to inline getElementError but without the postfixed prettifiedDOM (and with a comment linking back to their original implementation). Actually, for now I can set DEBUG_PRINT_LIMIT=0 to get the same behaviour...!
The pretty-dom +
getElementError
error that Testing Library outputs is super long for the e2e use case since we're working with entire pages instead of small units. So far, we're thinking of addressing this with either or both of the following:getElementError
to better suit our use case (strip<style />
+<script />
? — see last comment below for details/ideas)getElementError
configuration option from Testing LibraryOriginal Discussion
The text was updated successfully, but these errors were encountered: