diff options
Diffstat (limited to 'test/parallel/test-tls-lookup.js')
-rw-r--r-- | test/parallel/test-tls-lookup.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/parallel/test-tls-lookup.js b/test/parallel/test-tls-lookup.js index 4656d3e5cc..fddbb20ee0 100644 --- a/test/parallel/test-tls-lookup.js +++ b/test/parallel/test-tls-lookup.js @@ -6,8 +6,6 @@ if (!common.hasCrypto) const assert = require('assert'); const tls = require('tls'); -const expectedError = /^TypeError: "lookup" option should be a function$/; - ['foobar', 1, {}, []].forEach(function connectThrows(input) { const opts = { host: 'localhost', @@ -17,7 +15,10 @@ const expectedError = /^TypeError: "lookup" option should be a function$/; assert.throws(function() { tls.connect(opts); - }, expectedError); + }, common.expectsError({ + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + })); }); connectDoesNotThrow(common.mustCall(() => {})); |