test: fix internet/test-dns

The `nodejs.org` domain has now two TXT records.
Do not verify the exact number of records returned (only their shape),
and check that one of them is the SPF.

PR-URL: https://github.com/nodejs/node/pull/59660
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
Michaël Zasso committed 2025-09-04 10:15:14 +02:00
1 parent 56ac9a2d46
commit df63d37ec4
1 file changed
+3 -3
+3 -3
View File
@@ -523,9 +523,9 @@ TEST(function test_resolveTlsa_failure(done) {
TEST(async function test_resolveTxt(done) {
function validateResult(result) {
assert.ok(Array.isArray(result[0]));
assert.strictEqual(result.length, 1);
assert(result[0][0].startsWith('v=spf1'));
assert.ok(result.length > 0);
assert.ok(result.every((elem) => Array.isArray(elem) && elem.length === 1));
assert.ok(result.some((elem) => elem[0].startsWith('v=spf1')));
}
validateResult(await dnsPromises.resolveTxt(addresses.TXT_HOST));