test: fix syntax error in test-dns-idna2008.js when failing

Fixes a bug I introduced in 961322178d69325a46dbcbaea1da818fff12c45a

PR-URL: https://github.com/nodejs/node/pull/26570
Refs: https://github.com/nodejs/node/issues/25870
Refs: https://github.com/nodejs/node/pull/26473
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Refael Ackermann 2019-03-10 10:48:57 -04:00
parent f9ddbb6b2f
commit f77555f792

View File

@ -32,13 +32,15 @@ dns.lookup(fixture.hostname, mustCall((err, address) => {
assert.strictEqual(address, fixture.expectedAddress); assert.strictEqual(address, fixture.expectedAddress);
})); }));
dns.promises.lookup(fixture.hostname).then(mustCall(({ address }) => { dns.promises.lookup(fixture.hostname).then(({ address }) => {
assert.strictEqual(address, fixture.expectedAddress); assert.strictEqual(address, fixture.expectedAddress);
}).catch((err) => { }, (err) => {
if (err && err.errno === 'ESERVFAIL') { if (err && err.errno === 'ESERVFAIL') {
assert.ok(err.message.includes('queryA ESERVFAIL straße.de')); assert.ok(err.message.includes('queryA ESERVFAIL straße.de'));
} else {
throw err;
} }
})); }).finally(mustCall());
dns.resolve4(fixture.hostname, mustCall((err, addresses) => { dns.resolve4(fixture.hostname, mustCall((err, addresses) => {
assert.ifError(err); assert.ifError(err);