mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user