mirror of
https://github.com/tiennm99/open-domains.git
synced 2026-10-14 10:18:58 +00:00
Update domains.test.js
This commit is contained in:
1 parent
24c890127a
commit
ee5c8cace3
1 file changed
+2
-2
@@ -27,7 +27,7 @@ t("Nested subdomains should not exist without a valid parent domain", (t) => {
|
||||
// First-level subdomains have no immediate parent to check
|
||||
if (subdomain.split(".").length > 3) {
|
||||
// Get the immediate parent domain (remove the first subdomain part)
|
||||
const parentSubdomain = subdomain.split(".").slice(1).join(".");
|
||||
const parentSubdomain = subdomain.split(".").slice(-3).join(".");
|
||||
|
||||
// Ensure the immediate parent subdomain exists in the list of files
|
||||
t.true(
|
||||
@@ -54,7 +54,7 @@ t("Nested subdomains should not exist if the parent domain has NS records", (t)
|
||||
// First-level subdomains have no immediate parent to check
|
||||
if (subdomain.split(".").length > 3) {
|
||||
// Get the immediate parent domain, by getting the last 3 parts.
|
||||
const parentSubdomain = subdomain.split(".").slice(-3);
|
||||
const parentSubdomain = subdomain.split(".").slice(-3).join(".");
|
||||
const parentFilePath = path.join(domainsPath, `${parentSubdomain}.json`);
|
||||
|
||||
// Check if the parent file exists before attempting to read it
|
||||
|
||||
Reference in new issue
Block a user