mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 23:10:15 +00:00

* 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>
18 lines
406 B
JavaScript
18 lines
406 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const net = require('net');
|
|
const assert = require('assert');
|
|
|
|
|
|
// Hopefully nothing is running on common.PORT
|
|
const c = net.createConnection(common.PORT);
|
|
|
|
c.on('connect', function() {
|
|
common.fail('connected?!');
|
|
});
|
|
|
|
c.on('error', common.mustCall(function(e) {
|
|
console.error('couldn\'t connect.');
|
|
assert.strictEqual('ECONNREFUSED', e.code);
|
|
}));
|