From fcbdcd4ca5eb16c0f7657cf9299139d9404c02d4 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:59:21 -0500 Subject: [PATCH 01/16] Delete domains/_github-pages-challenge-clay990.suraj.is-cool.dev.json --- ...pages-challenge-clay990.suraj.is-cool.dev.json | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 domains/_github-pages-challenge-clay990.suraj.is-cool.dev.json diff --git a/domains/_github-pages-challenge-clay990.suraj.is-cool.dev.json b/domains/_github-pages-challenge-clay990.suraj.is-cool.dev.json deleted file mode 100644 index c5d411a2..00000000 --- a/domains/_github-pages-challenge-clay990.suraj.is-cool.dev.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "Portfolio project", - "domain": "is-cool.dev", - "subdomain": "_github-pages-challenge-clay990.suraj", - "owner": { - "repo": "https://github.com/Clay990/suraj", - "email": "asuraj991m@gmail.com" - }, - "record": { - "TXT": [ - "53a1f061ccd38386443e96e1948962" - ] - }, - "proxied": false -} From d423d0d836da6fa5b7abec360cd0ce15918db65e Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:59:35 -0500 Subject: [PATCH 02/16] Delete domains/_github-pages-challenge-homesteadrd.homesteadrdplaygroup.is-local.org.json --- ...eadrd.homesteadrdplaygroup.is-local.org.json | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 domains/_github-pages-challenge-homesteadrd.homesteadrdplaygroup.is-local.org.json diff --git a/domains/_github-pages-challenge-homesteadrd.homesteadrdplaygroup.is-local.org.json b/domains/_github-pages-challenge-homesteadrd.homesteadrdplaygroup.is-local.org.json deleted file mode 100644 index 69f7fed4..00000000 --- a/domains/_github-pages-challenge-homesteadrd.homesteadrdplaygroup.is-local.org.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "description": "Playgroup website", - - "domain": "is-local.org", - "subdomain": "_github-pages-challenge-homesteadrd.homesteadrdplaygroup", - - "owner": { - "repo": "https://github.com/homesteadrd/web", - "email": "homesteadrdplaygroup@gmail.com" - }, - - "record": { - "TXT": ["61fb25de94ffb44246bcda98b23911"] - }, - - "proxied": false -} From fb52d55e6d76f6b76fd3897a54a760ee010e569e Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:59:46 -0500 Subject: [PATCH 03/16] Delete domains/_github-pages-challenge-jinix6.crystalperson.is-cool.dev.json --- ...llenge-jinix6.crystalperson.is-cool.dev.json | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 domains/_github-pages-challenge-jinix6.crystalperson.is-cool.dev.json diff --git a/domains/_github-pages-challenge-jinix6.crystalperson.is-cool.dev.json b/domains/_github-pages-challenge-jinix6.crystalperson.is-cool.dev.json deleted file mode 100644 index aa8096fc..00000000 --- a/domains/_github-pages-challenge-jinix6.crystalperson.is-cool.dev.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "description": "GitHub Pages Verification vrahmanov", - - "domain": "is-cool.dev", - "subdomain": "_github-pages-challenge-jinix6.crystalperson", - - "owner": { - "repo": "https://github.com/jinix6/Craftland", - "email": "nanusahoo05@gmail.com" - }, - - "record": { - "TXT": ["50eb7583c6eeedf6f67806138d93bd"] - }, - - "proxied": false -} From 1dbc1eaa1b392378cf1d3ef73f0355361d519c4e Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:59:57 -0500 Subject: [PATCH 04/16] Delete domains/_github-pages-challenge-jinix6.crystalperson.is-local.org.json --- ...nge-jinix6.crystalperson.is-local.org.json | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 domains/_github-pages-challenge-jinix6.crystalperson.is-local.org.json diff --git a/domains/_github-pages-challenge-jinix6.crystalperson.is-local.org.json b/domains/_github-pages-challenge-jinix6.crystalperson.is-local.org.json deleted file mode 100644 index 4597b20f..00000000 --- a/domains/_github-pages-challenge-jinix6.crystalperson.is-local.org.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Verifying custom domain on Github", - - "domain": "is-local.org", - "subdomain": "_github-pages-challenge-jinix6.crystalperson", - - "owner": { - "repo": "https://github.com/jinix6/crystalperson.github.io", - "email": "nanusahoo05@gmail.com" - }, - - "record": { - "TXT": ["50eb7583c6eeedf6f67806138d93bd"] - }, - - "proxied": false -} - - From 02093f61813bc4a11d1692f6bc7dc04df6d851bc Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:00:05 -0500 Subject: [PATCH 05/16] Delete domains/_github-pages-challenge-narmis-e.narmis.is-cool.dev.json --- ...s-challenge-narmis-e.narmis.is-cool.dev.json | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 domains/_github-pages-challenge-narmis-e.narmis.is-cool.dev.json diff --git a/domains/_github-pages-challenge-narmis-e.narmis.is-cool.dev.json b/domains/_github-pages-challenge-narmis-e.narmis.is-cool.dev.json deleted file mode 100644 index d5854099..00000000 --- a/domains/_github-pages-challenge-narmis-e.narmis.is-cool.dev.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "description": "My portfolio hosted on GitHub Pages", - - "domain": "is-cool.dev", - "subdomain": "_github-pages-challenge-Narmis-E.narmis", - - "owner": { - "repo": "https://github.com/narmis-e/portfolio", - "email": "narmisecurb@gmail.com" - }, - - "record": { - "TXT": ["4213f5eb992ffe0d720bc237736a46"] - }, - - "proxied": false -} From fae42af3f82b42e12e56340afbd4cd963f041e61 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:00:15 -0500 Subject: [PATCH 06/16] Delete domains/_github-pages-challenge-openorganizationname.climatehealthei.is-local.org.json --- ...zationname.climatehealthei.is-local.org.json | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 domains/_github-pages-challenge-openorganizationname.climatehealthei.is-local.org.json diff --git a/domains/_github-pages-challenge-openorganizationname.climatehealthei.is-local.org.json b/domains/_github-pages-challenge-openorganizationname.climatehealthei.is-local.org.json deleted file mode 100644 index ade7a288..00000000 --- a/domains/_github-pages-challenge-openorganizationname.climatehealthei.is-local.org.json +++ /dev/null @@ -1,17 +0,0 @@ -{ -"description": "For verifying my domain with github pages", - -"domain": "is-local.org", -"subdomain": "_github-pages-challenge-OpenOrganizationName.climatehealthei", - -"owner": { -"repo": "https://github.com/FizzWizZleDazzle/climatehealthei.github.io", -"email": "arturmisiurev@gmail.com" -}, - -"record": { -"TXT": ["b038216c5480f640390bfcc7168d92"] -}, - -"proxied": false -} From ea4c0023179e4dc80fc6141634b1ee23f8acb7f0 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:00:25 -0500 Subject: [PATCH 07/16] Delete domains/_github-pages-challenge-py660.python660.is-loca.org.json --- ...pages-challenge-py660.python660.is-loca.org.json | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 domains/_github-pages-challenge-py660.python660.is-loca.org.json diff --git a/domains/_github-pages-challenge-py660.python660.is-loca.org.json b/domains/_github-pages-challenge-py660.python660.is-loca.org.json deleted file mode 100644 index b8438ab7..00000000 --- a/domains/_github-pages-challenge-py660.python660.is-loca.org.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "domain": "is-local.org", - "subdomain": "_github-pages-challenge-py660.python660", - - "owner": { - "repo": "https://github.com/py660/py660", - "email": "py660@irc.cluster.ws" - }, - - "record": { - "TXT": ["9f7bbf7a0a097f15d0b5c76076d9dd"] - } -} From 456fa7ef3ecf40cda4f6872e4d05bec1375a1ca3 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:00:33 -0500 Subject: [PATCH 08/16] Delete domains/_github-pages-challenge-tdevteam.thedevteam.is-cool.dev.json --- ...allenge-tdevteam.thedevteam.is-cool.dev.json | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 domains/_github-pages-challenge-tdevteam.thedevteam.is-cool.dev.json diff --git a/domains/_github-pages-challenge-tdevteam.thedevteam.is-cool.dev.json b/domains/_github-pages-challenge-tdevteam.thedevteam.is-cool.dev.json deleted file mode 100644 index 130eb0fc..00000000 --- a/domains/_github-pages-challenge-tdevteam.thedevteam.is-cool.dev.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "description": "To verify this domain for our github org", - - "domain": "is-cool.dev", - "subdomain": "_github-pages-challenge-TDevTeam.thedevteam", - - "owner": { - "repo": "https://github.com/tdevteam", - "email": "TheDevTeam@protonmail.com" - }, - - "record": { - "TXT": ["5e99f2d515b93bdffe4b1e960e1a85"] - }, - - "proxied": false -} From a34649e0e61e0e74844389cd745b2b33affd49bb Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:00:41 -0500 Subject: [PATCH 09/16] Delete domains/_github-pages-challenge-vijay2249.coachbeardjr.localplayer.dev.json --- ...e-vijay2249.coachbeardjr.localplayer.dev.json | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 domains/_github-pages-challenge-vijay2249.coachbeardjr.localplayer.dev.json diff --git a/domains/_github-pages-challenge-vijay2249.coachbeardjr.localplayer.dev.json b/domains/_github-pages-challenge-vijay2249.coachbeardjr.localplayer.dev.json deleted file mode 100644 index aef7772a..00000000 --- a/domains/_github-pages-challenge-vijay2249.coachbeardjr.localplayer.dev.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "Personal Website", - - "domain": "localplayer.dev", - "subdomain": "_github-pages-challenge-vijay2249.coachbeardjr", - - "owner": { - "email": "coachbeardjr.vvm8p@slmail.me" - }, - - "record": { - "TXT": ["dc0ebd8500ded55870bc8806c70dd5"] - }, - - "proxied": false -} From 7969019fb2d24492092be0921bdb9795d6c06d67 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:00:50 -0500 Subject: [PATCH 10/16] Delete domains/_github-pages-challenge-yesnielx.yesnielx.is-cool.dev.json --- ...hallenge-yesnielx.yesnielx.is-cool.dev.json | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 domains/_github-pages-challenge-yesnielx.yesnielx.is-cool.dev.json diff --git a/domains/_github-pages-challenge-yesnielx.yesnielx.is-cool.dev.json b/domains/_github-pages-challenge-yesnielx.yesnielx.is-cool.dev.json deleted file mode 100644 index 44206e7b..00000000 --- a/domains/_github-pages-challenge-yesnielx.yesnielx.is-cool.dev.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "GitHub Pages Verification", - - "domain": "is-cool.dev", - "subdomain": "_github-pages-challenge-YesnielX.yesnielx", - - "owner": { - "repo": "https://github.com/YesnielX/yesnielx.github.io", - "email": "yesnielviv2@gmail.com" - }, - - "record": { - "TXT": ["f5fe834daad27fc92c5d3a4b2e0135"] - }, - - "proxied": false - } - \ No newline at end of file From 3f4fbc35bd5b93c440b91a4f3ab5fdf2a1ce5e70 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:01:32 -0500 Subject: [PATCH 11/16] Delete domains/devil._domainkey.host.mycodelab.is-cool.dev.json --- ...il._domainkey.host.mycodelab.is-cool.dev.json | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 domains/devil._domainkey.host.mycodelab.is-cool.dev.json diff --git a/domains/devil._domainkey.host.mycodelab.is-cool.dev.json b/domains/devil._domainkey.host.mycodelab.is-cool.dev.json deleted file mode 100644 index 53773c50..00000000 --- a/domains/devil._domainkey.host.mycodelab.is-cool.dev.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "mycodelab mail, this is for temporary so i can transfer my mails to another account", - - "domain": "is-cool.dev", - "subdomain": "devil._domainkey.host.mycodelab", - - "owner": { - "repo": "https://github.com/ShadowGaming100/register" - }, - - "record": { - "TXT": ["v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRR//eLOhnpXyeRihLl1AnM/Ysj4cFG6873HAzsL4ubge6mmzmwGtb9xWQiY79kAfpQBv+CFnirFvMdZQldcJDMCbcrbeEBMaNxOi5udf1lmLH/6M1VMnu6Y2VCCoBSP7XhHqOVWDkThi1ROFB6mKwZQkypo+fz7tE6xwgVkJBCQIDAQAB;"] - }, - - "proxied": false -} From c488ab9872b692788b7b5cccf9c286fde4bfcf9a Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:02:16 -0500 Subject: [PATCH 12/16] Delete domains/amplify.is-a.fullstack.dev.json --- domains/amplify.is-a.fullstack.dev.json | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 domains/amplify.is-a.fullstack.dev.json diff --git a/domains/amplify.is-a.fullstack.dev.json b/domains/amplify.is-a.fullstack.dev.json deleted file mode 100644 index dfcf101c..00000000 --- a/domains/amplify.is-a.fullstack.dev.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "Amplify's Fullstack Domain", - "domain": "is-a-fullstack.dev", - "subdomain": "amplify", - - "owner": { - "repo": "https://github.com/not-amplify/free-domain/", - "email": "not.amplify@night-x.com" - }, - - "record": { - "NS" : ["summer.ns.cloudflare.com", "terry.ns.cloudflare.com" ] - }, - - "proxied": false -} From 707fcda5240a2156530070e3659b2c0fde722d88 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:02:32 -0500 Subject: [PATCH 13/16] Delete domains/potpry.is-cool.dev..json --- domains/potpry.is-cool.dev..json | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 domains/potpry.is-cool.dev..json diff --git a/domains/potpry.is-cool.dev..json b/domains/potpry.is-cool.dev..json deleted file mode 100644 index b89fcbba..00000000 --- a/domains/potpry.is-cool.dev..json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "Personal Cloud Study", - - "domain": "is-cool.dev", - "subdomain": "potpry", - - "owner": { - "email": "potprytest+open-domains@gmail.com" - }, - - "record": { - "A": ["158.247.216.53"] - }, - - "proxied": false -} From c31da7a6129b5146cb1c68f772dda1f99453fe6b Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:02:47 -0500 Subject: [PATCH 14/16] Delete domains/privacy.isdev.localplayer.dev.json --- domains/privacy.isdev.localplayer.dev.json | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 domains/privacy.isdev.localplayer.dev.json diff --git a/domains/privacy.isdev.localplayer.dev.json b/domains/privacy.isdev.localplayer.dev.json deleted file mode 100644 index 7b136ed5..00000000 --- a/domains/privacy.isdev.localplayer.dev.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "description": "website", - - "domain": "localplayer.dev", - "subdomain": "privacy.isdev", - - "owner": { - "repo": "https://github.com/is-a-dev/register", - "email": "andrew@win11react.com" - }, - - "record": { - "MX": ["mx.sendgrid.net"] - }, - - "proxied": false -} From 068d74d3d2ff171db4465233a19bcd2794a0b699 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:04:11 -0500 Subject: [PATCH 15/16] chore: formatting --- ...evil._domainkey.host.mycodelab.is-cool.dev.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 domains/devil._domainkey.host.mycodelab.is-cool.dev.json diff --git a/domains/devil._domainkey.host.mycodelab.is-cool.dev.json b/domains/devil._domainkey.host.mycodelab.is-cool.dev.json new file mode 100644 index 00000000..94a130d7 --- /dev/null +++ b/domains/devil._domainkey.host.mycodelab.is-cool.dev.json @@ -0,0 +1,14 @@ +{ + "description": "mycodelab mail, this is for temporary so i can transfer my mails to another account", + "domain": "is-cool.dev", + "subdomain": "devil._domainkey.host.mycodelab", + "owner": { + "repo": "https://github.com/ShadowGaming100/register" + }, + "record": { + "TXT": [ + "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRR//eLOhnpXyeRihLl1AnM/Ysj4cFG6873HAzsL4ubge6mmzmwGtb9xWQiY79kAfpQBv+CFnirFvMdZQldcJDMCbcrbeEBMaNxOi5udf1lmLH/6M1VMnu6Y2VCCoBSP7XhHqOVWDkThi1ROFB6mKwZQkypo+fz7tE6xwgVkJBCQIDAQAB;" + ] + }, + "proxied": false +} From 0e15c9479b6b2e9701f92563f4314fcf2cbd8cd0 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:08:58 -0500 Subject: [PATCH 16/16] chore: testing --- tests/domains.test.js | 79 ++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/tests/domains.test.js b/tests/domains.test.js index 9d592f4f..69fd3a4f 100644 --- a/tests/domains.test.js +++ b/tests/domains.test.js @@ -5,16 +5,17 @@ const path = require("path"); const domainsPath = path.resolve("domains"); const files = fs.readdirSync(domainsPath); -/** - * Helper function to determine if a subdomain is a root domain. - * A root domain is assumed to be exactly two parts (e.g., "is-cool.dev"). - */ -function isRootDomain(domain) { - return domain.split(".").length === 2; -} +// Extract valid root domains dynamically from the files +const validRootDomains = Array.from( + new Set( + files + .map((file) => file.split(".").slice(-2).join(".")) + .filter((domain) => domain.endsWith(".dev") || domain.endsWith(".org")) + ) +); -t("Nested subdomains should not exist without a parent subdomain", (t) => { - const issues = []; +t("Nested subdomains should not exist without a valid parent domain", (t) => { + const invalidFiles = []; files.forEach((file) => { // Skip directories and process only .json files @@ -25,28 +26,27 @@ t("Nested subdomains should not exist without a parent subdomain", (t) => { const subdomain = file.replace(/\.json$/, ""); - if (subdomain.split(".").length > 2) { - // Get parent domain by removing the leftmost part - const parentSubdomain = subdomain.split(".").slice(1).join("."); + // Find the first-level parent subdomain + const parentSubdomainParts = subdomain.split("."); + const rootDomain = parentSubdomainParts.slice(-2).join("."); + const firstLevelParent = `${parentSubdomainParts.slice(-3, -2)[0]}.${rootDomain}`; - // Skip check if the parent subdomain is a root domain - if (isRootDomain(parentSubdomain)) { - return; - } - - // Check if the parent subdomain exists - if (!files.includes(`${parentSubdomain}.json`)) { - issues.push(`${file}: Parent subdomain ${parentSubdomain}.json does not exist`); - } + if ( + parentSubdomainParts.length > 2 && // Must have at least one subdomain + validRootDomains.includes(rootDomain) && // Must belong to a valid root domain + !files.includes(`${firstLevelParent}.json`) // Parent must exist + ) { + invalidFiles.push(`${file}: Parent domain ${firstLevelParent}.json does not exist`); } }); - // Report all issues at once - t.deepEqual(issues, [], `Found issues:\n${issues.join("\n")}`); + // Fail the test if there are invalid files + invalidFiles.forEach((message) => t.fail(message)); + t.pass(); }); -t("Nested subdomains should not exist if the parent subdomain has NS records", (t) => { - const issues = []; +t("Nested subdomains should not exist if the parent domain has NS records", (t) => { + const invalidFiles = []; files.forEach((file) => { // Skip directories and process only .json files @@ -57,30 +57,25 @@ t("Nested subdomains should not exist if the parent subdomain has NS records", ( const subdomain = file.replace(/\.json$/, ""); - if (subdomain.split(".").length > 2) { - // Get parent domain by removing the leftmost part - const parentSubdomain = subdomain.split(".").slice(1).join("."); - const parentFilePath = path.join(domainsPath, `${parentSubdomain}.json`); + // Find the first-level parent subdomain + const parentSubdomainParts = subdomain.split("."); + const rootDomain = parentSubdomainParts.slice(-2).join("."); + const firstLevelParent = `${parentSubdomainParts.slice(-3, -2)[0]}.${rootDomain}`; + const parentFilePath = path.join(domainsPath, `${firstLevelParent}.json`); - // Skip check if the parent subdomain is a root domain - if (isRootDomain(parentSubdomain)) { - return; - } - - // Check if the parent file exists before attempting to read it + if (parentSubdomainParts.length > 2 && validRootDomains.includes(rootDomain)) { if (fs.existsSync(parentFilePath)) { const parentDomain = fs.readJsonSync(parentFilePath); - - // Check if the parent has NS records - if (parentDomain.record.NS !== undefined) { - issues.push(`${file}: Parent subdomain ${parentSubdomain} has NS records`); + if (parentDomain.record?.NS) { + invalidFiles.push(`${file}: Parent domain ${firstLevelParent} has NS records`); } } else { - issues.push(`${file}: Parent subdomain ${parentSubdomain}.json file does not exist`); + invalidFiles.push(`${file}: Parent domain ${firstLevelParent}.json does not exist`); } } }); - // Report all issues at once - t.deepEqual(issues, [], `Found issues:\n${issues.join("\n")}`); + // Fail the test if there are invalid files + invalidFiles.forEach((message) => t.fail(message)); + t.pass(); });