21 lines
788 B
TypeScript
21 lines
788 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { describe, expect, it } from "@suaveplan/testing/runner";
|
|
|
|
describe("tree-shake", () => {
|
|
it("sideEffects is false", { timeout: 5000 }, () => {
|
|
const pkg = JSON.parse(
|
|
readFileSync(join(__dirname, "..", "package.json"), "utf8")
|
|
) as { sideEffects?: boolean };
|
|
expect(pkg.sideEffects).toBe(false);
|
|
});
|
|
|
|
it("exports has at least 6 entries", { timeout: 5000 }, () => {
|
|
const pkg = JSON.parse(
|
|
readFileSync(join(__dirname, "..", "package.json"), "utf8")
|
|
) as { exports?: Record<string, unknown> };
|
|
expect(pkg.exports).toBeDefined();
|
|
expect(Object.keys(pkg.exports ?? {}).length).toBeGreaterThanOrEqual(6);
|
|
});
|
|
});
|