diff options
Diffstat (limited to 'test/parallel/test-net-socket-constructor.js')
-rw-r--r-- | test/parallel/test-net-socket-constructor.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-net-socket-constructor.js b/test/parallel/test-net-socket-constructor.js index 6758e286fb..ec2e99deb8 100644 --- a/test/parallel/test-net-socket-constructor.js +++ b/test/parallel/test-net-socket-constructor.js @@ -4,6 +4,14 @@ const common = require('../common'); const assert = require('assert'); const net = require('net'); +common.expectsError(() => { + new net.Socket({ fd: -1 }); +}, { code: 'ERR_OUT_OF_RANGE' }); + +common.expectsError(() => { + new net.Socket({ fd: 'foo' }); +}, { code: 'ERR_INVALID_ARG_TYPE' }); + function test(sock, readable, writable) { let socket; if (sock instanceof net.Socket) { |