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 error codes for test-dns-idna2008 #48270

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions test/internet/test-dns-idna2008.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ dns.promises.lookup(fixture.hostname, { family: fixture.family })
.then(({ address }) => {
assert.strictEqual(address, fixture.expectedAddress);
}, (err) => {
if (err && err.errno === 'ESERVFAIL') {
assert.ok(err.message.includes('queryA ESERVFAIL straße.de'));
if (err && err.code === 'ENOTFOUND') {
assert.ok(err.message.includes('queryA ENOTFOUND ENOTFOUND.de'));
anonrig marked this conversation as resolved.
Show resolved Hide resolved
} else {
throw err;
}
}).finally(mustCall());

dns.resolve4(fixture.hostname, mustCall((err, addresses) => {
if (err && err.errno === 'ESERVFAIL') {
assert.ok(err.message.includes('queryA ESERVFAIL straße.de'));
if (err && err.code === 'ENOTFOUND') {
assert.ok(err.message.includes('queryA ENOTFOUND straße.de'));
return;
}
assert.ifError(err);
Expand All @@ -61,8 +61,8 @@ const p = new dns.promises.Resolver().resolve4(fixture.hostname);
p.then((addresses) => {
assert.deepStrictEqual(addresses, [fixture.expectedAddress]);
}, (err) => {
if (err && err.errno === 'ESERVFAIL') {
assert.ok(err.message.includes('queryA ESERVFAIL straße.de'));
if (err && err.code === 'ENOTFOUND') {
assert.ok(err.message.includes('queryA ENOTFOUND straße.de'));
} else {
throw err;
}
Expand Down