From d743783875f145e9b15654ed1a085688b37eb513 Mon Sep 17 00:00:00 2001 From: Artur Vieira Date: Mon, 8 May 2017 01:17:58 +0000 Subject: [PATCH] test: use assert regexp in tls no cert test Replace the `assert.throws` second argument from a Type to a `RegExp` matching the entire error message. Error message changes are `semver-major`, so we assert their content. PR-URL: https://github.com/nodejs/node/pull/12891 Refs: https://github.com/nodejs/node/pull/12603 Reviewed-By: Refael Ackermann Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: David Cai Reviewed-By: Luigi Pinca Reviewed-By: Sakthipriyan Vairamani Reviewed-By: James M Snell --- test/parallel/test-tls-no-cert-required.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-tls-no-cert-required.js b/test/parallel/test-tls-no-cert-required.js index 3c7cf4462f..001f6443c1 100644 --- a/test/parallel/test-tls-no-cert-required.js +++ b/test/parallel/test-tls-no-cert-required.js @@ -20,7 +20,8 @@ tls.createServer(assert.fail) tls.createServer({}) .listen(0, common.mustCall(close)); -assert.throws(() => tls.createServer('this is not valid'), TypeError); +assert.throws(() => tls.createServer('this is not valid'), + /^TypeError: options must be an object$/); tls.createServer() .listen(0, common.mustCall(close));