Initial Commit
This commit is contained in:
50
packages/foundation/core/env/tests/dep-graph.test.ts
vendored
Normal file
50
packages/foundation/core/env/tests/dep-graph.test.ts
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "@suaveplan/testing/runner";
|
||||
|
||||
const pkg = JSON.parse(
|
||||
readFileSync(join(__dirname, "..", "package.json"), "utf8")
|
||||
) as {
|
||||
dependencies?: Record<string, string>;
|
||||
devDependencies?: Record<string, string>;
|
||||
};
|
||||
|
||||
describe("dep-graph", () => {
|
||||
it("has required runtime deps", { timeout: 5000 }, () => {
|
||||
const deps = pkg.dependencies ?? {};
|
||||
expect(deps).toHaveProperty("@suaveplan/error");
|
||||
expect(deps).toHaveProperty("@suaveplan/types");
|
||||
expect(deps).toHaveProperty("tslib");
|
||||
expect(deps).toHaveProperty("zod");
|
||||
});
|
||||
|
||||
it("runtime deps use workspace:^ for internal packages", {
|
||||
timeout: 5000,
|
||||
}, () => {
|
||||
const deps = pkg.dependencies ?? {};
|
||||
expect(deps["@suaveplan/error"]).toBe("workspace:^");
|
||||
expect(deps["@suaveplan/types"]).toBe("workspace:^");
|
||||
});
|
||||
|
||||
it("does not have @opentelemetry/api as a runtime dep", {
|
||||
timeout: 5000,
|
||||
}, () => {
|
||||
const deps = pkg.dependencies ?? {};
|
||||
// OTel is intentionally not a runtime dep for this package
|
||||
expect(Object.keys(deps)).not.toContain("@opentelemetry/api");
|
||||
});
|
||||
|
||||
it("has fast-check in devDependencies for property tests", {
|
||||
timeout: 5000,
|
||||
}, () => {
|
||||
const devDeps = pkg.devDependencies ?? {};
|
||||
expect(devDeps).toHaveProperty("fast-check");
|
||||
});
|
||||
|
||||
it("has mitata in devDependencies for benchmarks", {
|
||||
timeout: 5000,
|
||||
}, () => {
|
||||
const devDeps = pkg.devDependencies ?? {};
|
||||
expect(devDeps).toHaveProperty("mitata");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user