From 481104118091a5f5133a450443a8ec3dfdc2c375 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 3 Sep 2026 23:33:27 +0100 Subject: [PATCH] tests: improve vercel verification tests --- tests/records.test.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/records.test.js b/tests/records.test.js index c668f1dc30..113f1c505d 100644 --- a/tests/records.test.js +++ b/tests/records.test.js @@ -296,15 +296,23 @@ function validateRecordValues(t, data, file) { t("All files should have valid records", (t) => { files.forEach((file) => { + const data = getDomainData(file); + const recordKeys = Object.keys(data.records); + if (file.startsWith("_vercel")) { t.true( /^_vercel\.[^.]+\.json$/.test(file), `${file}: Files starting with '_vercel' must have format '_vercel..json'` ); - } - const data = getDomainData(file); - const recordKeys = Object.keys(data.records); + const txtRecords = data.records.TXT; + const txtList = Array.isArray(txtRecords) ? txtRecords : [txtRecords]; + + t.true( + txtList.length > 0 && txtList.every((record) => typeof record === "string" && record.startsWith("vc-domain-verify=")), + `${file}: Vercel verification files must contain at least one TXT record and all TXT records must start with 'vc-domain-verify='` + ); + } recordKeys.forEach((key) => { t.true(validateRecordType(key), `${file}: Invalid record type: ${key}`);