test: improve test-net-socket-timeout
- Check for custom Node.js code rather than constructor in assert.throws().
- Use arrow functions consistently.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines