From 660e58c7ebf98ca4a05570aeffe12e5940ffdc3b 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 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$/);