mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-13 10:15:47 +00:00
new pr tests + prettier
This commit is contained in:
1 parent
44e4f18142
commit
6339f26bef
8 files changed
+152
-252
No files matched your search
+9
-16
@@ -25,29 +25,22 @@ function validateProxiedRecords(t, data, file) {
|
||||
const recordTypes = Array.from(requiredRecordsToProxy).join(", ");
|
||||
|
||||
if (data.proxied) {
|
||||
const hasProxiedRecord = Object.keys(data.record).some((key) =>
|
||||
requiredRecordsToProxy.has(key),
|
||||
);
|
||||
const hasProxiedRecord = Object.keys(data.record).some((key) => requiredRecordsToProxy.has(key));
|
||||
|
||||
t.true(
|
||||
hasProxiedRecord,
|
||||
`${file}: Proxied is true but there are no records that can be proxied (${recordTypes} expected)`,
|
||||
`${file}: Proxied is true but there are no records that can be proxied (${recordTypes} expected)`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const domainsPath = path.resolve("domains");
|
||||
const files = fs
|
||||
.readdirSync(domainsPath)
|
||||
.filter((file) => file.endsWith(".json"));
|
||||
const files = fs.readdirSync(domainsPath).filter((file) => file.endsWith(".json"));
|
||||
|
||||
t(
|
||||
"Domains with proxy enabled must have at least one proxy-able record",
|
||||
(t) => {
|
||||
files.forEach((file) => {
|
||||
const domain = getDomainData(file);
|
||||
t("Domains with proxy enabled must have at least one proxy-able record", (t) => {
|
||||
files.forEach((file) => {
|
||||
const domain = getDomainData(file);
|
||||
|
||||
validateProxiedRecords(t, domain, file);
|
||||
});
|
||||
},
|
||||
);
|
||||
validateProxiedRecords(t, domain, file);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user