Skip to content

Commit 1a84f06

Browse files
coreybeaumontevanlucas
coreybeaumont
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 3114349 commit 1a84f06

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ require('../common');
33
const assert = require('assert');
44
const net = 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: options must be an object$/);
8+
assert.throws(function() { net.createServer(0); },
9+
/^TypeError: options must be an object$/);

0 commit comments

Comments
 (0)