0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-22 07:37:56 +01:00
nodejs/test/internet/test-dns-txt-sigsegv.js
Anna Henningsen 2c4ebe0426
test: use .then(common.mustCall()) for all async IIFEs
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>
2020-07-20 18:13:28 +02:00

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);
});