-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test: move the corresponding IPv4 and IPv6 tests #28124
Conversation
Move the IPv4 and IPv6 test in the isIp file to the corresponding file, and remove non-string tests(isIP test is only for string input).
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.
@zero1five Thanks a lot for your change but I have some concerns with this:
In case of a failure the test would only report e.g. 0 !== 4
. It would not tell what ip
was used in the specific test. Thus, the usefulness seems to decrease due to the change.
It also removes a couple of tests that do not seem to be duplicated tests. For those reasons I am -1 on this change.
assert.strictEqual(net.isIPv4(null), false); | ||
assert.strictEqual(net.isIPv4(123), false); | ||
assert.strictEqual(net.isIPv4(true), false); | ||
assert.strictEqual(net.isIPv4({}), false); |
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.
These cases are not tested in the other file. Is there a specific reason for removing them?
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.
About this, I think isIPxx
since it only supports string input, testing non-string input is an unnecessary test, don't get useful feedback in run the test case.
I'm not sure if it should do this kind of testing in node, imo, It is up to the user to make a simple assertion before using it.
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.
I am not certain I can follow. We verify that the API works as expected and to have a full coverage.
@BridgeAR Yes! I ignored the fact that the error message was not very readable, so I made some changes, and it now looks like this:
add error messages to make it easier to read. |
8ae28ff
to
2935f72
Compare
Ping @BridgeAR, looks like this needed a follow up review from you. |
@zero1five This would need a rebase to solve the conflicts. |
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. |
Move the IPv4 and IPv6 test in the isIp file to the corresponding file,
and remove non-string tests(isIP test is only for string input).
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes