mirror of
https://github.com/tiennm99/open-domains.git
synced 2026-10-14 10:18:58 +00:00
Update tests/records.test.js
Co-authored-by: William Harrison <87287585+wdhdev@users.noreply.github.com>
This commit is contained in:
1 parent
7b0fdceac5
commit
693fa51df5
1 file changed
+3
-10
+3
-10
@@ -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}`);
|
||||
}
|
||||
|
||||
// *: {}[]
|
||||
|
||||
Reference in new issue
Block a user