30 lines
919 B
TypeScript
30 lines
919 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import { describe, expect, it } from "@suaveplan/testing/runner";
|
|
|
|
const pkg = JSON.parse(
|
|
readFileSync(new URL("../package.json", import.meta.url), "utf8")
|
|
) as { exports: Record<string, unknown>; sideEffects: boolean };
|
|
|
|
describe("exports — subpath surface", () => {
|
|
it("every feature module has a subpath export entry", {
|
|
timeout: 5000,
|
|
}, () => {
|
|
const expected = [
|
|
".",
|
|
"./detector/beat-detector",
|
|
"./algorithms/energy-odf",
|
|
"./algorithms/spectral-flux",
|
|
"./algorithms/comb-tempo",
|
|
"./algorithms/beat-grid",
|
|
"./error-codes",
|
|
];
|
|
for (const key of expected) {
|
|
expect(pkg.exports[key]).toBeDefined();
|
|
}
|
|
});
|
|
|
|
it("sideEffects is false", { timeout: 5000 }, () => {
|
|
expect(pkg.sideEffects).toBe(false);
|
|
});
|
|
});
|