Skip to content

Commit

Permalink
test: Update to const and use regex for assertions
Browse files Browse the repository at this point in the history
Use const over var.

Assert error message with regex.

PR-URL: #9891
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Intregrisist authored and jasnell committed Dec 4, 2016
1 parent f9274f0 commit 4a204ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-net-localerror.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down

0 comments on commit 4a204ee

Please sign in to comment.