From 5cd7e7aaf1cda681cd796b4b726b78e3659f922b Mon Sep 17 00:00:00 2001 From: Daniel Flores Date: Thu, 1 Dec 2016 10:12:47 -0600 Subject: [PATCH] test: Update to const and use regex for assertions Use const over var. Assert error message with regex. PR-URL: https://github.com/nodejs/node/pull/9891 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/parallel/test-net-localerror.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-net-localerror.js b/test/parallel/test-net-localerror.js index ed7c9471e0..1793a3de3b 100644 --- a/test/parallel/test-net-localerror.js +++ b/test/parallel/test-net-localerror.js @@ -1,19 +1,19 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); connect({ host: 'localhost', port: common.PORT, localPort: 'foobar', -}, 'localPort should be a number: foobar'); +}, /^TypeError: localPort should be a number: foobar$/); connect({ host: 'localhost', port: common.PORT, localAddress: 'foobar', -}, 'localAddress should be a valid IP: foobar'); +}, /^TypeError: localAddress must be a valid IP: foobar$/); function connect(opts, msg) { assert.throws(function() {