Repository navigation
test: cover the heartbeat-events utility functions - #827
Conversation
🛝 WordPress PlaygroundsBuilt from d7f5392
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
rejaulalomkhan
left a comment
There was a problem hiding this comment.
Thanks for working on this, @kamrulhasanj! Covering both the jQuery path and the native CustomEvent fallback of heartbeat-events is useful, since so far these helpers were only mocked in other tests.
I ran the new file and the full Vitest suite locally (47 tests pass, lint clean), and tried a few deliberate mutations of heartbeat-events.js to see what the tests catch. Six of seven were caught; I left one small note inline about the native cleanup assertion.
AI Review: Claude Opus 5.5
josephfusco
left a comment
There was a problem hiding this comment.
Welcome, and thanks for these! Once Rejaul's suggestion is in, this is ready to merge.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #827 +/- ##
============================================
+ Coverage 97.11% 97.55% +0.43%
- Complexity 269 272 +3
============================================
Files 30 30
Lines 4372 4378 +6
============================================
+ Hits 4246 4271 +25
+ Misses 126 107 -19
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
josephfusco
left a comment
There was a problem hiding this comment.
Thanks, Kamrul, and thanks for the review, Rejaul!
Adds unit tests covering the jQuery, native CustomEvent fallback, and Heartbeat availability paths in heartbeat-events.
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini
Used for: Test structure and coverage verification; reviewed and validated locally against coding standards and test suites.