Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: event debugging (WIP) #1726

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

Open
mdjastrzebski wants to merge 1 commit into main
base: main
Choose a base branch
Loading
from feat/event-debugging
Open

Conversation

Copy link
Member

@mdjastrzebski mdjastrzebski commented Jan 7, 2025
edited
Loading

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

jerone and MattAgn reacted with rocket emoji
Copy link

codecov bot commented Jan 7, 2025
edited
Loading

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.

Copy link
Member Author

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

concurrentRoot: boolean;

/**
* Verbose logging for the library.
Copy link
Collaborator

Choose a reason for hiding this comment

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

i would add what it helps log : user event and fire event issues (for now)

asyncUtilTimeout: 1000,
defaultIncludeHiddenElements: false,
concurrentRoot: true,
debug: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

imo true is a good default because otherwise i fear not many people will hear about it and remember to turn it on
do you see more advantages with false as default ?

Copy link
Collaborator

MattAgn commented Aug 18, 2025

This is gonna be so helpful to debug! ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@pierrezimmermannbam pierrezimmermannbam Awaiting requested review from pierrezimmermannbam

@AugustinLF AugustinLF Awaiting requested review from AugustinLF

1 more reviewer

@MattAgn MattAgn MattAgn approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

UX: feedback when event could not be triggered due to disabled state, etc Log when fireEvent fails to fire an event

AltStyle によって変換されたページ (->オリジナル) /