Skip to content

Commit

Permalink
test: use assert regexp in tls no cert test
Browse files Browse the repository at this point in the history
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: #12891
Refs: #12603
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: David Cai <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
arturgvieira authored and MylesBorins committed Jul 11, 2017
1 parent 29d35d0 commit d743783
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-tls-no-cert-required.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d743783

Please sign in to comment.