fixed non instance error

This commit is contained in:
jhartworks committed 2026-11-09 11:01:36 +01:00
1 parent 6b41267b7f
commit 137014a0b8
8 files changed
+137 -9

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { test } from "node:test";
import { validateModule, validateSymconPackage } from "./validate-package.mjs";
const module = JSON.parse(readFileSync(new URL("../NextFloor/module.json", import.meta.url), "utf8"));
test("the shipped library contains a discoverable NextFloor module and its browser bundles", () => {
const installed = validateSymconPackage();
assert.deepEqual(installed.modules.map((entry) => entry.id), [module.id]);
});
test("a visualization module type cannot silently hide the PHP device from Add instance", () => {
assert.throws(() => validateModule({ ...module, type: 6 }), /supported PHP module type/);
});
test("the missing documentation URL reported by the official schema is rejected", () => {
const { url, ...incomplete } = module;
assert.throws(() => validateModule(incomplete), /missing required field 'url'/);
});