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 <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • 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.