Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix test-net-* error code check for getaddrinfo(3) #5099

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/parallel/test-net-better-error-messages-port-hostname.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ var common = require('../common');
var net = require('net');
var assert = require('assert');

var c = net.createConnection(common.PORT, '...');
var c = net.createConnection(common.PORT, '***');

c.on('connect', common.fail);

c.on('error', common.mustCall(function(e) {
assert.equal(e.code, 'ENOTFOUND');
assert.equal(e.port, common.PORT);
assert.equal(e.hostname, '...');
assert.equal(e.hostname, '***');
}));
4 changes: 2 additions & 2 deletions test/parallel/test-net-connect-immediate-finish.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ const common = require('../common');
const assert = require('assert');
const net = require('net');

const client = net.connect({host: '...', port: common.PORT});
const client = net.connect({host: '***', port: common.PORT});

client.once('error', common.mustCall(function(err) {
assert(err);
assert.strictEqual(err.code, err.errno);
assert.strictEqual(err.code, 'ENOTFOUND');
assert.strictEqual(err.host, err.hostname);
assert.strictEqual(err.host, '...');
assert.strictEqual(err.host, '***');
assert.strictEqual(err.syscall, 'getaddrinfo');
}));

Expand Down