Browse Source

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 <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6.x
Artur Vieira 8 years ago
committed by Myles Borins
parent
commit
d743783875
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 3
      test/parallel/test-tls-no-cert-required.js

3
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));

Loading…
Cancel
Save