Browse Source

test: update test-net-connect-handle-econnrefused

* var -> const
* assert.equal() -> assert.strictEqual()
* assert.ok(false) -> common.fail()

PR-URL: https://github.com/nodejs/node/pull/9932
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v7.x
Punit Buch 8 years ago
committed by Jeremiah Senkpiel
parent
commit
79b36e927c
  1. 13
      test/parallel/test-net-connect-handle-econnrefused.js

13
test/parallel/test-net-connect-handle-econnrefused.js

@ -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);
}));

Loading…
Cancel
Save