Skip to content

Commit

Permalink
test: fix test-dns-idna2008.js
Browse files Browse the repository at this point in the history
The test should pass if ESERVFAIL is the result.

Refs: #25870 (comment)

PR-URL: #27208
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott committed Apr 15, 2019
1 parent 82e6c33 commit f6bd3b2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/internet/test-dns-idna2008.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,21 @@ dns.promises.lookup(fixture.hostname).then(({ address }) => {
}).finally(mustCall());

dns.resolve4(fixture.hostname, mustCall((err, addresses) => {
if (err && err.errno === 'ESERVFAIL') {
assert.ok(err.message.includes('queryA ESERVFAIL straße.de'));
return;
}
assert.ifError(err);
assert.deepStrictEqual(addresses, [fixture.expectedAddress]);
}));

const p = new dns.promises.Resolver().resolve4(fixture.hostname);
p.then(mustCall((addresses) => {
p.then((addresses) => {
assert.deepStrictEqual(addresses, [fixture.expectedAddress]);
}));
}, (err) => {
if (err && err.errno === 'ESERVFAIL') {
assert.ok(err.message.includes('queryA ESERVFAIL straße.de'));
} else {
throw err;
}
}).finally(mustCall());

0 comments on commit f6bd3b2

Please sign in to comment.