54 lines
1.7 KiB
TypeScript
54 lines
1.7 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { join, resolve } from "node:path";
|
|
import { describe, expect, it } from "@suaveplan/testing/runner";
|
|
import { MAIN_BRANCH_COMPONENT_FAMILIES } from "./parity-fixture.js";
|
|
|
|
const PKG_ROOT = resolve(__dirname, "..");
|
|
const PKG_JSON = JSON.parse(
|
|
readFileSync(join(PKG_ROOT, "package.json"), "utf8")
|
|
) as { exports: Record<string, unknown> };
|
|
|
|
describe("main-branch parity", () => {
|
|
it("every main-branch component family has a genesis equivalent", {
|
|
timeout: 5000,
|
|
}, () => {
|
|
const missing: string[] = [];
|
|
for (const entry of MAIN_BRANCH_COMPONENT_FAMILIES) {
|
|
for (const subpath of entry.genesisSubpaths) {
|
|
if (PKG_JSON.exports[subpath] === undefined) {
|
|
missing.push(
|
|
`${entry.mainFamily} -> ${subpath} (not exported)`
|
|
);
|
|
}
|
|
}
|
|
}
|
|
expect(missing).toEqual([]);
|
|
});
|
|
|
|
it("fixture lists every required parity family", {
|
|
timeout: 5000,
|
|
}, () => {
|
|
const expected = [
|
|
"audio-dashboard",
|
|
"audio-engine-controls",
|
|
"audio-player",
|
|
"audio-provider",
|
|
"audio-visualizer",
|
|
"basic-player",
|
|
"glados-controls",
|
|
"microphone-controls",
|
|
"mixer-controls",
|
|
"players",
|
|
"plugin-chain",
|
|
"plugin-controls",
|
|
"plugin-loader",
|
|
"plugins",
|
|
"preset-manager",
|
|
];
|
|
const got = MAIN_BRANCH_COMPONENT_FAMILIES.map((e) => e.mainFamily);
|
|
for (const name of expected) {
|
|
expect(got.includes(name)).toBe(true);
|
|
}
|
|
});
|
|
});
|