test: refactor test-dgram-address.js
- separate the IPv4 and IPv6 tests using block scopes
- use
common.mustCall()
and arrow functions for callbacks - add coverage for case where
address()
throws
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
test