Skip to content

Commit cfe7b34

Browse files
vieiraarturgrefack
authored andcommitted
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: #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]>
1 parent 317180f commit cfe7b34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/parallel/test-tls-no-cert-required.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ tls.createServer(assert.fail)
4141
tls.createServer({})
4242
.listen(0, common.mustCall(close));
4343

44-
assert.throws(() => tls.createServer('this is not valid'), TypeError);
44+
assert.throws(() => tls.createServer('this is not valid'),
45+
/^TypeError: options must be an object$/);
4546

4647
tls.createServer()
4748
.listen(0, common.mustCall(close));

0 commit comments

Comments
 (0)