Skip to content

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Oct 7, 2025

Follow up of #60125

@nodejs-github-bot nodejs-github-bot added addons Issues and PRs related to native addons. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Oct 7, 2025
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.56%. Comparing base (da9cd74) to head (72c550e).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60142      +/-   ##
==========================================
- Coverage   88.56%   88.56%   -0.01%     
==========================================
  Files         704      704              
  Lines      208123   208123              
  Branches    40014    40013       -1     
==========================================
- Hits       184330   184318      -12     
- Misses      15815    15824       +9     
- Partials     7978     7981       +3     

see 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 7, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 7, 2025
@nodejs-github-bot
Copy link
Collaborator

@lpinca
Copy link
Member

lpinca commented Oct 7, 2025

There are cases where common.mustCall() (& co.) is omitted on purpose because invariants, dedicated tests, and logic make it redundant. For example, it doesn't make much sense to use it every time an assertion is found in a setTimeout() callback if dedicated tests already exist for setTimeout(). For this reason I'm not a fan of these refactors that blindly add it everywhere. Sometimes it is only unnecessary overhead.

@aduh95
Copy link
Contributor Author

aduh95 commented Oct 7, 2025

For example, it doesn't make much sense to use it every time an assertion is found in a setTimeout() callback if dedicated tests already exist for setTimeout()

I've thought about making setTimeout part of the exceptions, but decided against it because there are many things that could cause a timer to never run its callback.

Sometimes it is only unnecessary overhead.

Sure but the other side of the coin is that sometimes it is actually useful and will catch a regression / bug as I did in #60125 (comment). I certainly agree that it adds redundancy, but arguably that's a good thing for tests.

For this reason I'm not a fan of these refactors that blindly add it everywhere.

I'm not sure "blindly" is fair, I've spent quite some time crafting this PR and gauging which of mustCall, mustCallAtLeast or eslint-disable-next-line was appropriate.

@aduh95 aduh95 force-pushed the must-call-mustCalls branch from f425312 to 51084ca Compare October 10, 2025 20:37
@aduh95 aduh95 force-pushed the must-call-mustCalls branch from 51084ca to 72c550e Compare October 12, 2025 20:55
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

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

Labels

addons Issues and PRs related to native addons. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants