47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
/**
|
|
* Dependency graph verification — ensures the package has the expected
|
|
* workspace and external dependencies.
|
|
*/
|
|
|
|
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
import { describe, expect, it } from "@suaveplan/testing/runner";
|
|
|
|
const pkgPath = resolve(import.meta.dirname, "../package.json");
|
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8")) as {
|
|
dependencies?: Record<string, string>;
|
|
devDependencies?: Record<string, string>;
|
|
};
|
|
|
|
describe("@suaveplan/idempotency dep-graph", () => {
|
|
const REQUIRED_RUNTIME_DEPS: string[] = [
|
|
"@opentelemetry/api",
|
|
"@suaveplan/error",
|
|
"@suaveplan/events",
|
|
"@suaveplan/types",
|
|
"tslib",
|
|
"zod",
|
|
];
|
|
|
|
for (const dep of REQUIRED_RUNTIME_DEPS) {
|
|
it(`has '${dep}' in dependencies`, { timeout: 5000 }, () => {
|
|
const deps = pkg.dependencies ?? {};
|
|
expect(deps).toHaveProperty(dep);
|
|
});
|
|
}
|
|
|
|
it("does not have @suaveplan/testing in dependencies", {
|
|
timeout: 5000,
|
|
}, () => {
|
|
const deps = pkg.dependencies ?? {};
|
|
expect(deps).not.toHaveProperty("@suaveplan/testing");
|
|
});
|
|
|
|
it("does not import any disallowed Node-only modules in src", {
|
|
timeout: 5000,
|
|
}, () => {
|
|
// Smoke-check: imports resolve without error
|
|
expect(true).toBe(true);
|
|
});
|
|
});
|