39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { describe, expect, it } from "@suaveplan/testing/runner";
|
|
|
|
describe("package exports", () => {
|
|
it("every feature module has a subpath export entry", {
|
|
timeout: 5000,
|
|
}, () => {
|
|
const pkg = JSON.parse(
|
|
readFileSync(join(__dirname, "..", "package.json"), "utf-8")
|
|
);
|
|
const keys = Object.keys(pkg.exports);
|
|
for (const expected of [
|
|
".",
|
|
"./source/file-source",
|
|
"./sink/file-sink",
|
|
"./adapter/server-adapter",
|
|
"./fx/plugin-chain",
|
|
"./error-codes",
|
|
]) {
|
|
expect(keys).toContain(expected);
|
|
}
|
|
});
|
|
|
|
it("sideEffects is false", { timeout: 5000 }, () => {
|
|
const pkg = JSON.parse(
|
|
readFileSync(join(__dirname, "..", "package.json"), "utf-8")
|
|
);
|
|
expect(pkg.sideEffects).toBe(false);
|
|
});
|
|
|
|
it("engines pins node >=22", { timeout: 5000 }, () => {
|
|
const pkg = JSON.parse(
|
|
readFileSync(join(__dirname, "..", "package.json"), "utf-8")
|
|
);
|
|
expect(pkg.engines.node).toMatch(/22/);
|
|
});
|
|
});
|