Skip to content

Commit 89e76e8

Browse files
coreybeaumontMylesBorins
authored andcommitted
test: improved type checking with regex
Replaced TypeError with a regular expression of the actual error. PR-URL: #12591 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent c304414 commit 89e76e8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎test/parallel/test-net-server-options.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ require('../common');
33
constassert=require('assert');
44
constnet=require('net');
55

6-
assert.throws(function(){net.createServer('path');},TypeError);
7-
assert.throws(function(){net.createServer(0);},TypeError);
6+
assert.throws(function(){net.createServer('path');},
7+
/^TypeError:optionsmustbeanobject$/);
8+
assert.throws(function(){net.createServer(0);},
9+
/^TypeError:optionsmustbeanobject$/);

0 commit comments

Comments
(0)