Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configurable debug print size with DEBUG_PRINT_LIMIT env var #322

Open
cdimitroulas opened this issue Dec 21, 2021 · 3 comments
Open
Labels
help wanted Extra attention is needed STATE: Need response

Comments

@cdimitroulas
Copy link

Is your feature request related to a problem? Please describe.
Other testing-library libs have the ability to configure the size of the debug output by using the DEBUG_PRINT_LIMIT env variable. This doesn't seem to work with testcafe-testing-library.

Describe the solution you'd like
Allow setting DEBUG_PRINT_LIMIT to increase the size of the default debug print when selectors like getByText fail to find an element.

Describe alternatives you've considered
N/A

Additional context
N/A

@benmonro
Copy link
Member

benmonro commented Jun 9, 2022

would welcome a PR for this. :)

@benmonro benmonro added the help wanted Extra attention is needed label Jun 9, 2022
@cdimitroulas
Copy link
Author

Will try to find some time to look into this

@cdimitroulas
Copy link
Author

@benmonro I tried to dig into this a bit but wasn't able to make much progress.

I tried to replicate the tests from here as a starting point but I wasn't able to figure out how to capture the error message which includes a printout of the DOM in the test code since that error occurs on the client-side when running with testcafe.

Similarly, the way the DEBUG_PRINT_LIMIT works in testing-library/dom is by looking for process.env.DEBUG_PRINT_LIMIT which makes sense in a Node.js environment but is slightly weirder on the client-side. The only idea I had was to try setting up a window.process.env object on the client-side and pass this env var to the client-side somehow. Do you have any advice on how this could be done nicely with testcafe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed STATE: Need response
Projects
None yet
Development

No branches or pull requests

2 participants