Skip to content

Commit

Permalink
test: update test-net-connect-handle-econnrefused
Browse files Browse the repository at this point in the history
* var -> const
* assert.equal() -> assert.strictEqual()
* assert.ok(false) -> common.fail()

PR-URL: nodejs#9932
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
itspun authored and addaleax committed Dec 8, 2016
1 parent 75712a3 commit 093adca
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/parallel/test-net-connect-handle-econnrefused.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
'use strict';
var common = require('../common');
var net = require('net');
var assert = require('assert');
const common = require('../common');
const net = require('net');
const assert = require('assert');


// Hopefully nothing is running on common.PORT
var c = net.createConnection(common.PORT);
const c = net.createConnection(common.PORT);

c.on('connect', function() {
console.error('connected?!');
assert.ok(false);
common.fail('connected?!');
});

c.on('error', common.mustCall(function(e) {
console.error('couldn\'t connect.');
assert.equal('ECONNREFUSED', e.code);
assert.strictEqual('ECONNREFUSED', e.code);
}));

0 comments on commit 093adca

Please sign in to comment.