mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-12 22:14:49 +00:00
Merge pull request #50611 from is-a-dev/roman/improve-vercel-verification-tests
tests: improve vercel verification tests
This commit is contained in:
5 files changed
+11
-43
No files matched your search
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "ahmad9059",
|
||||
"email": "ahmadhassan9059@gmail.com"
|
||||
},
|
||||
"records": {
|
||||
"TXT": "vc-domain-verify-ahmadhassan.is-a.dev,a4d39f00ccf974cccd0e"
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "AVBharath10",
|
||||
"email": "avbharath1221@gmail.com"
|
||||
},
|
||||
"records": {
|
||||
"TXT": [
|
||||
"vc-domain-verify-bharathav.is-a.dev,4d40c2ac67021482e173"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "kelvinojedaepn",
|
||||
"email": "kelvin.ojeda.071@outlook.com"
|
||||
},
|
||||
"records": {
|
||||
"TXT": [
|
||||
"vc-domain-verify:kelvinoj.is-a.dev,19bf00c0f781d8ea2a9d"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "mdwisu",
|
||||
"email": "dwisusanto784@gmail.com"
|
||||
},
|
||||
"records": {
|
||||
"TXT": "_vercel=vc-domain-verify=mdwisu.is-a.dev,bf198376796ed111ef61"
|
||||
}
|
||||
}
|
||||
+11
-3
@@ -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.<name>.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}`);
|
||||
|
||||
Reference in new issue
Block a user