Prechádzať zdrojové kódy

TEST: Ensure app has a categories field

Nicolas Meienberger 3 rokov pred
rodič
commit
b073e70f0d
1 zmenil súbory, kde vykonal 11 pridanie a 1 odobranie
  1. 11 1
      apps/__tests__/apps.test.ts

+ 11 - 1
apps/__tests__/apps.test.ts

@@ -4,6 +4,7 @@ import jsyaml from "js-yaml";
 interface AppConfig {
   id: string;
   port: number;
+  categories: string[];
   requirements?: {
     ports?: number[];
   };
@@ -17,7 +18,7 @@ interface AppConfig {
   available: boolean;
 }
 
-const networkExceptions = ["pihole", "tailscale", "homeassistant"];
+const networkExceptions = ["pihole", "tailscale", "homeassistant", "plex"];
 const getAppConfigs = (): AppConfig[] => {
   const apps: AppConfig[] = [];
 
@@ -74,6 +75,15 @@ describe("App configs", () => {
     });
   });
 
+  it("Each app should have categories defined as an array", () => {
+    const apps = getAppConfigs();
+
+    apps.forEach((app) => {
+      expect(app.categories).toBeDefined();
+      expect(app.categories).toBeInstanceOf(Array);
+    });
+  });
+
   it("Each app should have a name", () => {
     const apps = getAppConfigs();