summaryrefslogtreecommitdiff
path: root/test/parallel/test-net-options-lookup.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-net-options-lookup.js')
-rw-r--r--test/parallel/test-net-options-lookup.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/parallel/test-net-options-lookup.js b/test/parallel/test-net-options-lookup.js
index f0e8b34c80..337a071a19 100644
--- a/test/parallel/test-net-options-lookup.js
+++ b/test/parallel/test-net-options-lookup.js
@@ -1,10 +1,8 @@
'use strict';
-require('../common');
+const common = require('../common');
const assert = require('assert');
const net = require('net');
-const expectedError = /^TypeError: "lookup" option should be a function$/;
-
['foobar', 1, {}, []].forEach((input) => connectThrows(input));
// Using port 0 as lookup is emitted before connecting.
@@ -17,7 +15,10 @@ function connectThrows(input) {
assert.throws(() => {
net.connect(opts);
- }, expectedError);
+ }, common.expectsError({
+ code: 'ERR_INVALID_ARG_TYPE',
+ type: TypeError
+ }));
}
connectDoesNotThrow(() => {});