Initial Commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
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/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user