mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-14 02:16:15 +00:00
prettier + updates to tests
This commit is contained in:
1 parent
0bab0f1756
commit
bc55135cef
50 files changed
+372
-203
No files matched your search
+16
-9
@@ -25,22 +25,29 @@ 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