// Home Assistant runs without the Servarr apps and without a broker, so those requirements are optional // (novox/hq ADR 0330, issue 166): a mesh without lidarr or an MQTT broker can assign home-assistant, and // nothing is installed for it. Its provisions step already reads a binding that is not there as absent. import { test } from "node:test"; import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; type Requirement = string | { name: string; optional?: boolean }; const manifest = JSON.parse(readFileSync(new URL("../module.json", import.meta.url), "utf8")) as { requires: Requirement[] }; test("the Servarr APIs and mqtt-topic are optional, and route stays hard", () => { for (const name of ["sonarr-api", "radarr-api", "lidarr-api", "mqtt-topic"]) { assert.ok( manifest.requires.some((r) => typeof r !== "string" && r.name === name && r.optional === true), `${name} is not optional`, ); } assert.ok(manifest.requires.includes("route")); });