mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
test: improved type checking with regex
Replaced TypeError with a regular expression of the actual error. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
c304414007
commit
89e76e8e4d
1 file changed
+4
-2
@@ -3,5 +3,7 @@ require('../common');
|
||||
const assert = require('assert');
|
||||
const net = require('net');
|
||||
|
||||
assert.throws(function() { net.createServer('path'); }, TypeError);
|
||||
assert.throws(function() { net.createServer(0); }, TypeError);
|
||||
assert.throws(function() { net.createServer('path'); },
|
||||
/^TypeError: options must be an object$/);
|
||||
assert.throws(function() { net.createServer(0); },
|
||||
/^TypeError: options must be an object$/);
|
||||
Reference in new issue
Block a user