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: nodejs#25870 (comment)
  • Loading branch information
Trott committed Apr 13, 2019
1 parent 9b6b567 commit 4fd2912
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 4fd2912

Please sign in to comment.