From cfe7b34058716d9c9dfb143ecc865a30f433db5c 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 04a8b91cf8e354..06139307c43ce6 100644 --- a/test/parallel/test-tls-no-cert-required.js +++ b/test/parallel/test-tls-no-cert-required.js @@ -41,7 +41,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));