mirror of
https://github.com/nodejs/node.git
synced 2024-11-22 07:37:56 +01:00
2c4ebe0426
This makes sure that all async functions finish as expected. PR-URL: https://github.com/nodejs/node/pull/34363 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
16 lines
446 B
JavaScript
16 lines
446 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const dns = require('dns');
|
|
const dnsPromises = dns.promises;
|
|
|
|
(async function() {
|
|
const result = await dnsPromises.resolveTxt('www.microsoft.com');
|
|
assert.strictEqual(result.length, 0);
|
|
})().then(common.mustCall());
|
|
|
|
dns.resolveTxt('www.microsoft.com', function(err, records) {
|
|
assert.strictEqual(err, null);
|
|
assert.strictEqual(records.length, 0);
|
|
});
|