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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Intregrisist authored and MylesBorins committed Dec 21, 2016
1 parent 63a3acd commit a9d0c9d
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 a9d0c9d

Please sign in to comment.