Skip to content

Commit

Permalink
test: improved type checking with regex
Browse files Browse the repository at this point in the history
Replaced TypeError with a regular expression of the actual error.

PR-URL: nodejs/node#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>
  • Loading branch information
coreybeaumont authored and andrew749 committed Jul 19, 2017
1 parent 8c2944c commit d7402d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/parallel/test-net-server-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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$/);

0 comments on commit d7402d6

Please sign in to comment.