-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
test: update coverage for dgram.js #10783
Conversation
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 close! Left a few comments.
const socket = dgram.createSocket('udp4'); | ||
|
||
socket.bind(0); | ||
socket.on('listening', () => { |
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.
Please wrap the callback here in common.mustCall()
|
||
socket.bind(0); | ||
socket.on('listening', function() { | ||
socket.setMulticastTTL(16); | ||
socket.on('listening', () => { |
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.
common.mustCall()
here as well.
} catch (e) { | ||
thrown = true; | ||
} | ||
}, /setMulticastTTL/, 'TTL must be a number from > 0 to < 256'); |
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.
The regex should test the entire error message
ff42392
to
fb2cfdf
Compare
@jasnell Updated! PTAL:) |
socket.on('listening', common.mustCall(() => { | ||
const result = socket.setMulticastLoopback(16); | ||
assert.strictEqual(result, 16); | ||
|
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.
Can you remove this line please.
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.
OK, Deleted :)
Create test-dgram-multicast-loopback.js for dgram.setMulticastLoopback. Add a test which has an argument of an invalid number to test-dgram-setTTL.js. https://github.com/nodejs/node/blob/master/lib/dgram.js#L464 Add a test which has an argument of a string to test-dgram-multicast-setTTL.js. https://github.com/nodejs/node/blob/master/lib/dgram.js#L473
fb2cfdf
to
e2131ec
Compare
one more CI before merging |
maybe the same reason |
Landed 2057a63 |
PR-URL: #10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Create test-dgram-multicast-loopback.js for dgram.setMulticastLoopback.
Add a test which has an argument of an invalid number to test-dgram-setTTL.js.
https://github.com/nodejs/node/blob/master/lib/dgram.js#L464
Add a test which has an argument of a string to test-dgram-multicast-setTTL.js.
https://github.com/nodejs/node/blob/master/lib/dgram.js#L473
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test