Skip to content

Commit 89e76e8

Browse files
coreybeaumontMylesBorins
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 <rtrott@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent c304414 commit 89e76e8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: 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)