feat(learn): clean up code sample & update/correct time mocking section#8707
feat(learn): clean up code sample & update/correct time mocking section#8707JakobJingleheimer wants to merge 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/test_runner Please review the changes when you have a chance. Thank you! 🙏 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8707 +/- ##
==========================================
+ Coverage 75.09% 75.10% +0.01%
==========================================
Files 104 104
Lines 9161 9161
Branches 315 315
==========================================
+ Hits 6879 6880 +1
+ Misses 2280 2279 -1
Partials 2 2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
Updates the Node.js test-runner “Mocking” learning page to correct the time-mocking guidance and simplify the accompanying examples (per linked Node.js issue/PR).
Changes:
- Refactors the module-mocking example to set up
mock.module()and perform the consumer import in-sequence within thedescribeblock. - Fixes the time-mocking example to enable
mock.timersbefore importing the module under test, and adds an explicit explanation of why a dynamic import is required.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Build Size ComparisonSummary
Changes➕ Added Assets (1)
➖ Removed Assets (1)
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Resolves nodejs/node#62081
Resolves nodejs/node#62141