Skip to content

Debug helper on get calls. #41

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

Closed
wants to merge 5 commits into from
Closed

Debug helper on get calls. #41

wants to merge 5 commits into from

Conversation

antsmartian
Copy link
Collaborator

@antsmartian antsmartian commented Apr 3, 2018

What: This is already discussed here : #31

Why: Again discussed here : #31

How:

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

@antsmartian
Copy link
Collaborator Author

antsmartian commented Apr 3, 2018

@kentcdodds Hey Kent.. I have just initiated the thread for printing the DOM element when get calls fails. I have added the code only for getByText. Here is how my console looks:

screen shot 2018-04-03 at 2 16 09 pm

Looks cool to me and definitely its going to help in debugging the process as discussed.

Things that are pending:

  1. We need to set some limit, may be we can expose that as a env variable something like, DEBUG_PRINT_LIMIT, else fallback to 7000 as discussed.
  2. Update all the get calls with the same logic.
  3. Update the readme about the point 1.
  4. Add/Update tests w.r.t to get calls.

I guess that should be fine, let me know what you feel.

Note: The sample test case will be failing, anyways will fix once we are good to merge this PR.

@antsmartian antsmartian requested a review from kentcdodds April 3, 2018 09:05
Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Yes, let's move forward with your plan. I like the environment variable idea. Thanks!

@antsmartian
Copy link
Collaborator Author

Cool! Will get back on this by weekend.

@codecov
Copy link

codecov bot commented Apr 6, 2018

Codecov Report

Merging #41 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #41   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines          98    115   +17     
  Branches       22     25    +3     
=====================================
+ Hits           98    115   +17
Impacted Files Coverage Δ
src/queries.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7267acd...8ad1be3. Read the comment docs.

@antsmartian
Copy link
Collaborator Author

@kentcdodds Updated the codebase, let me know if anything else is pending.

@kentcdodds
Copy link
Member

Could we move this over to dom-testing-library?

Sorry to change things underneath you!

@kentcdodds kentcdodds closed this Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants