From 095f5528b4d236660b9480035303693f86131dfd Mon Sep 17 00:00:00 2001 From: coreybeaumont Date: Sat, 22 Apr 2017 11:07:32 -0700 Subject: [PATCH] test: improved type checking with regex Replaced TypeError with a regular expression of the actual error. --- test/parallel/test-net-server-options.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-net-server-options.js b/test/parallel/test-net-server-options.js index db0054d7637d69..be7e40e49bf16f 100644 --- a/test/parallel/test-net-server-options.js +++ b/test/parallel/test-net-server-options.js @@ -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$/);