Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improved type checking with regex #12591

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: improved type checking with regex
Replaced TypeError with a regular expression of the actual error.
  • Loading branch information
coreybeaumont committed Apr 22, 2017
commit 095f5528b4d236660b9480035303693f86131dfd
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$/);