From dfa03b6684872d24d194e78ce117f88f08f3bc9e Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 27 Aug 2026 14:17:23 +0100 Subject: [PATCH] chore: make tests stricter --- tests/records.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/records.test.js b/tests/records.test.js index 043b88a8da..382d6423bb 100644 --- a/tests/records.test.js +++ b/tests/records.test.js @@ -240,6 +240,11 @@ function validateRecordValues(t, data, file) { t.true(typeof record === "string", `${file}: TXT record value should be a string at index ${idx}`); if (record.startsWith("vc-domain-verify=")) { + t.true( + file.startsWith("_vercel."), + `${file}: vc-domain-verify TXT records are only allowed in files starting with _vercel.` + ); + const domainToken = record.split("vc-domain-verify=")[1].split(",")[0]; t.true( @@ -289,6 +294,13 @@ function validateRecordValues(t, data, file) { t("All files should have valid records", (t) => { files.forEach((file) => { + 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);