mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-15 12:14:26 +00:00
remove services from tests
This commit is contained in:
1 parent
21dc3e5351
commit
a75c5c24d5
3 files changed
+2
-105
No files matched your search
+2
-23
@@ -11,8 +11,7 @@ const requiredFields = {
|
||||
|
||||
const optionalFields = {
|
||||
proxied: "boolean",
|
||||
redirect_config: "object",
|
||||
services: "object"
|
||||
redirect_config: "object"
|
||||
};
|
||||
|
||||
const requiredOwnerFields = {
|
||||
@@ -28,7 +27,7 @@ const optionalRedirectConfigFields = {
|
||||
redirect_paths: "boolean"
|
||||
};
|
||||
|
||||
const blockedFields = ["domain", "internal", "proxy", "reserved", "subdomain"];
|
||||
const blockedFields = ["domain", "internal", "proxy", "reserved", "services", "subdomain"];
|
||||
|
||||
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||
const hostnameRegex = /^(?=.{1,253}$)(?:(?:[_a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)\.)+[a-zA-Z]{2,63}$/;
|
||||
@@ -150,26 +149,6 @@ async function processFile(file, t) {
|
||||
validateFields(t, data.redirect_config, optionalRedirectConfigFields, file, "redirect_config");
|
||||
}
|
||||
|
||||
if (data.services) {
|
||||
if (data.services.discord) {
|
||||
t.true(
|
||||
Array.isArray(data.services.discord) || typeof data.services.discord === "string",
|
||||
`${file}: services.discord should be an array or string`
|
||||
);
|
||||
}
|
||||
|
||||
if (data.services.vercel) {
|
||||
t.true(
|
||||
Array.isArray(data.services.vercel) || typeof data.services.vercel === "string",
|
||||
`${file}: services.vercel should be an array or string`
|
||||
);
|
||||
}
|
||||
|
||||
if (data.services.bluesky) {
|
||||
t.true(typeof data.services.bluesky === "string", `${file}: services.bluesky should be a string`);
|
||||
}
|
||||
}
|
||||
|
||||
for (const field of blockedFields) {
|
||||
t.true(!data.hasOwnProperty(field), `${file}: Disallowed field: ${field}`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user