Initial Commit
This commit is contained in:
28
packages/gaming/games/ecs/tests/dep-graph.test.ts
Normal file
28
packages/gaming/games/ecs/tests/dep-graph.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "@suaveplan/testing/runner";
|
||||
|
||||
const ALLOWED_RUNTIME_DEPS = new Set([
|
||||
"@opentelemetry/api",
|
||||
"@suaveplan/error",
|
||||
"@suaveplan/events",
|
||||
"@suaveplan/opentelemetry",
|
||||
"@suaveplan/types",
|
||||
"tslib",
|
||||
"zod",
|
||||
]);
|
||||
|
||||
describe("dependency graph", () => {
|
||||
it("runtime dependencies are restricted to the declared allowlist", {
|
||||
timeout: 5000,
|
||||
}, async () => {
|
||||
const pkg = JSON.parse(
|
||||
await readFile(join(__dirname, "..", "package.json"), "utf8")
|
||||
) as { dependencies: Record<string, string> };
|
||||
const declared = new Set(Object.keys(pkg.dependencies));
|
||||
const extras = [...declared].filter(
|
||||
(d) => !ALLOWED_RUNTIME_DEPS.has(d)
|
||||
);
|
||||
expect(extras).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user