fix: restore Symcon instance discovery
This commit is contained in:
1 parent
45aae13c09
commit
e1321b6b34
8 files changed
+137
-9
No files matched your search
@@ -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'/);
|
||||
});
|
||||
Reference in new issue
Block a user