From 8097b3b1eca14c42f92074b4dfb0451e26e19a60 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 ed7c9471e0397f..184e55c890b2bb 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" option should be a number: foobar$/); connect({ host: 'localhost', port: common.PORT, localAddress: 'foobar', -}, 'localAddress should be a valid IP: foobar'); +}, /^TypeError: "localAddress" option must be a valid IP: foobar$/); function connect(opts, msg) { assert.throws(function() {