mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
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>
This commit is contained in:
1 parent
ba7d1cf4bc
commit
79b36e927c
1 file changed
+6
-7
@@ -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);
|
||||
}));
|
||||
Reference in new issue
Block a user