mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-12 16:15:21 +00:00
chore: make tests stricter
This commit is contained in:
1 parent
7b84cbdf01
commit
dfa03b6684
1 file changed
+12
@@ -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.<name>.json'`
|
||||
);
|
||||
}
|
||||
|
||||
const data = getDomainData(file);
|
||||
const recordKeys = Object.keys(data.records);
|
||||
|
||||
|
||||
Reference in new issue
Block a user