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

feat: event debugging (WIP) #1726

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

feat: event debugging (WIP) #1726

wants to merge 6 commits into from

Conversation

mdjastrzebski
Copy link
Member

@mdjastrzebski mdjastrzebski commented Jan 7, 2025

Summary

Resolves #1717
Resolves #1718

Introduces (event) debugging mode that outputs information about event handles not being called due to disabled state, etc.

Details

Enabling: configure({ debug: true }). Cannot be configured on render as fireEvent and userEvent are independent modules, not returns from render.

Fire Event:

  • logs warnings when event handler was found but disabled:
  • logs warning when no event handler was invoked for given fireEvent call.

User Event:

  • logs debug for events that have missing event handlers.

To Do

  • User Event: log warning if no event at all has been called for given userEvent call.
  • Fire Event & User Event: consider logging debug for matches/called event handlers.

Test plan

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 86.17886% with 17 lines in your changes missing coverage. Please review.

Project coverage is 95.47%. Comparing base (17ccd9e) to head (95845da).

Files with missing lines Patch % Lines
src/helpers/logger.ts 59.25% 11 Missing ⚠️
src/fire-event.ts 86.36% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1726      +/-   ##
==========================================
- Coverage   95.50%   95.47%   -0.04%     
==========================================
  Files          92       92              
  Lines        5139     5235      +96     
  Branches      563      901     +338     
==========================================
+ Hits         4908     4998      +90     
- Misses        231      237       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mdjastrzebski mdjastrzebski force-pushed the feat/event-debugging branch 3 times, most recently from ec51869 to 81a631b Compare January 13, 2025 11:05
@mdjastrzebski
Copy link
Member Author

Could you share your feedback on this potential new feature @pierrezimmermannbam @MattAgn @AugustinLF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant