-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
assert: change callTracker.calls signature to use an object param instead of positional arguments #43341
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
assert: change callTracker.calls signature to use an object param instead of positional arguments #43341
Conversation
07acc4d
to
ae31757
Compare
Can you change the subsystem in the first line of the commit message from |
@nodejs/assert |
it changes the callTracker API, its docs and tests that use this module Refs: nodejs#43161
ae31757
to
a14d9bb
Compare
uh! done! |
#callChecks = new SafeSet(); | ||
|
||
calls(fn, exact = 1) { | ||
calls({ fn = noop, exact = 1 } = { fn: noop, exact: 1 }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unnecessary breaking change. The old signature should keep working, or must be deprecated first.
None of the existing tests should need to be modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed it here #43161 as the old signature is a bit confusing I thought it'd be better change from positional to object arguments.
This is my first time working on an experimental feature so I thought everything should be moved to the new signature. Even for experimental features we should keep the old tests?
Do you have an example of how to deprecate the old signature? I haven't seen people deprecating functions from experimental features so I'm a bit lost on it haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I forgot that CallTracker
is still experimental. Still, it's been around since Node.js 12, and there is no reason to break every application that's using it.
I would maintain both signatures for now and then maybe deprecate the old signature at some point.
With that being said, unless we have specific options that we want to add later, I am not sure if this an improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh nice! Do you think it’s still valid to ads this change?
Hey @ErickWendel let me know if you want feedback/help with this when you're here for NodeTLV. In general I think what Tobias suggested is good basically:
|
Suure thank you!! I’ll try doing it by the next week. 🤩🤩 |
it changes the calls function from the callTracker API, its docs, and tests that use this module. This is a breaking change as the calls function was changed
Refs: #43161