Update tests/records.test.js

Co-authored-by: William Harrison <87287585+wdhdev@users.noreply.github.com>
This commit is contained in:
JonandWilliam Harrison authored and GitHub committed 2024-11-13 09:26:51 -05:00
1 parent 7b0fdceac5
commit 693fa51df5
1 file changed
+3 -10
+3 -10
View File
@@ -195,17 +195,10 @@ t("All files should have valid record values", (t) => {
}
}
// *: string
if (["CNAME", "URL"].includes(key)) {
// CNAME: string
if (key === "CNAME") {
t.true(typeof value === "string", `${file}: Record value should be a string for ${key}`);
if (key === "CNAME") {
t.regex(value, hostnameRegex, `${file}: Record value should be a valid hostname for ${key}`);
}
if (key === "URL") {
t.notThrows(() => new URL(value), `${file}: Record value should be a valid URL for ${key}`);
}
t.regex(value, hostnameRegex, `${file}: Record value should be a valid hostname for ${key}`);
}
// *: {}[]