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.
  • Loading branch information
Intregrisist committed Dec 3, 2016
1 parent 8264a22 commit f2cd619
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 f2cd619

Please sign in to comment.