27 lines
938 B
TypeScript
27 lines
938 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { describe, expect, it } from "@suaveplan/testing/runner";
|
|
|
|
const PKG_DIR = join(import.meta.dirname, "..");
|
|
|
|
describe("dep-graph", () => {
|
|
it("runtime deps stay minimal (error, tslib, zod only)", {
|
|
timeout: 5000,
|
|
}, () => {
|
|
const raw = JSON.parse(
|
|
readFileSync(join(PKG_DIR, "package.json"), "utf8")
|
|
) as {
|
|
dependencies?: Record<string, string>;
|
|
};
|
|
const deps = Object.keys(raw.dependencies ?? {}).sort();
|
|
expect(deps).toEqual(["@suaveplan/error", "tslib", "zod"]);
|
|
});
|
|
|
|
it("declares a single bin entry", { timeout: 5000 }, () => {
|
|
const raw = JSON.parse(
|
|
readFileSync(join(PKG_DIR, "package.json"), "utf8")
|
|
) as { bin?: Record<string, string> };
|
|
expect(Object.keys(raw.bin ?? {})).toEqual(["create-suaveplan-plugin"]);
|
|
});
|
|
});
|