mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-15 22:15:09 +00:00
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:
1 parent
b650b09297
commit
0c81cb966f
290 files changed
+603
-730
No files matched your search
+20
-2
@@ -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`
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user