Initial Commit
This commit is contained in:
29
packages/api-stack/api/api-router/tests/dep-graph.test.ts
Normal file
29
packages/api-stack/api/api-router/tests/dep-graph.test.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "@suaveplan/testing/runner";
|
||||
|
||||
describe("dep-graph", () => {
|
||||
it("pins exact runtime dependency set", { timeout: 5000 }, () => {
|
||||
const pkg = JSON.parse(
|
||||
readFileSync(new URL("../package.json", import.meta.url), "utf8")
|
||||
) as {
|
||||
dependencies: Record<string, string>;
|
||||
};
|
||||
expect(Object.keys(pkg.dependencies).sort()).toEqual(
|
||||
[
|
||||
"@suaveplan/api-types",
|
||||
"@suaveplan/error",
|
||||
"@suaveplan/types",
|
||||
"tslib",
|
||||
"zod",
|
||||
].sort()
|
||||
);
|
||||
});
|
||||
|
||||
it("root barrel has no export-star", { timeout: 5000 }, () => {
|
||||
const src = readFileSync(
|
||||
new URL("../src/index.ts", import.meta.url),
|
||||
"utf8"
|
||||
);
|
||||
expect(src.includes("export *")).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user