Skip to content

Commit f6bd3b2

Browse files
committedApr 15, 2019
test: fix test-dns-idna2008.js
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]>
1 parent 82e6c33 commit f6bd3b2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

‎test/internet/test-dns-idna2008.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,21 @@ dns.promises.lookup(fixture.hostname).then(({ address }) => {
4343
}).finally(mustCall());
4444

4545
dns.resolve4(fixture.hostname, mustCall((err, addresses) => {
46+
if (err && err.errno === 'ESERVFAIL') {
47+
assert.ok(err.message.includes('queryA ESERVFAIL straße.de'));
48+
return;
49+
}
4650
assert.ifError(err);
4751
assert.deepStrictEqual(addresses, [fixture.expectedAddress]);
4852
}));
4953

5054
const p = new dns.promises.Resolver().resolve4(fixture.hostname);
51-
p.then(mustCall((addresses) => {
55+
p.then((addresses) => {
5256
assert.deepStrictEqual(addresses, [fixture.expectedAddress]);
53-
}));
57+
}, (err) => {
58+
if (err && err.errno === 'ESERVFAIL') {
59+
assert.ok(err.message.includes('queryA ESERVFAIL straße.de'));
60+
} else {
61+
throw err;
62+
}
63+
}).finally(mustCall());

0 commit comments

Comments
 (0)
Please sign in to comment.