Skip to content

Commit 69c43bd

Browse files
targosmarco-ippolito
authored andcommitted
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: #59660 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent 068c439 commit 69c43bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/internet/test-dns.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,9 @@ TEST(function test_resolveCname_failure(done) {
482482

483483
TEST(async function test_resolveTxt(done) {
484484
function validateResult(result) {
485-
assert.ok(Array.isArray(result[0]));
486-
assert.strictEqual(result.length, 1);
487-
assert(result[0][0].startsWith('v=spf1'));
485+
assert.ok(result.length > 0);
486+
assert.ok(result.every((elem) => Array.isArray(elem) && elem.length === 1));
487+
assert.ok(result.some((elem) => elem[0].startsWith('v=spf1')));
488488
}
489489

490490
validateResult(await dnsPromises.resolveTxt(addresses.TXT_HOST));

0 commit comments

Comments
 (0)