feat(ci): nested domains should have same username

- Prettier
- Delete some nested subdomains with different owners
- Fix some domains
- Lowercase all CNAME, MX, NS records for formatting purposes
This commit is contained in:
William Harrison committed 2024-11-15 16:52:36 +08:00
1 parent b650b09297
commit 0c81cb966f
290 files changed
+603 -730

No files matched your search

+20 -2
View File
@@ -7,7 +7,7 @@ const files = fs.readdirSync(domainsPath);
t("Nested subdomains should not exist without a parent subdomain", (t) => {
files.forEach((file) => {
const subdomain = file.replace(".json", "");
const subdomain = file.replace(/\.json$/, "");
if (subdomain.split(".").length > 1) {
const parentSubdomain = subdomain.split(".").pop();
@@ -21,7 +21,7 @@ t("Nested subdomains should not exist without a parent subdomain", (t) => {
t("Nested subdomains should not exist if the parent subdomain has NS records", (t) => {
files.forEach((file) => {
const subdomain = file.replace(".json", "");
const subdomain = file.replace(/\.json$/, "");
if (subdomain.split(".").length > 1) {
const parentSubdomain = subdomain.split(".").pop();
@@ -33,3 +33,21 @@ t("Nested subdomains should not exist if the parent subdomain has NS records", (
t.pass();
});
t("Nested subdomains should be owned by the parent subdomain's owner", (t) => {
files.forEach((file) => {
const subdomain = file.replace(/\.json$/, "");
if (subdomain.split(".").length > 1) {
const data = fs.readJsonSync(path.join(domainsPath, file));
const parentSubdomain = subdomain.split(".").pop();
const parentDomain = fs.readJsonSync(path.join(domainsPath, `${parentSubdomain}.json`));
t.true(
data.owner.username.toLowerCase() === parentDomain.owner.username.toLowerCase(),
`${file}: owner.username is not the same as the parent subdomain`
);
}
});
});