From d7402d606d7655452b667653359899ac8022a6a3 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. PR-URL: https://github.com/nodejs/node/pull/12591 Reviewed-By: Rich Trott Reviewed-By: Jeremiah Senkpiel Reviewed-By: Colin Ihrig Reviewed-By: Santiago Gimeno Reviewed-By: Gibson Fahnestock Reviewed-By: James M Snell --- 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 db0054d7637d..be7e40e49bf1 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$/);