41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { describe, expect, it } from "@suaveplan/testing/runner";
|
|
|
|
const PKG_DIR = join(__dirname, "..");
|
|
|
|
interface PackageJson {
|
|
exports: Record<string, unknown>;
|
|
sideEffects?: boolean;
|
|
}
|
|
|
|
describe("subpath exports", () => {
|
|
const pkg = JSON.parse(
|
|
readFileSync(join(PKG_DIR, "package.json"), "utf8")
|
|
) as PackageJson;
|
|
|
|
it("every feature module has a subpath export entry", {
|
|
timeout: 5000,
|
|
}, () => {
|
|
const required = [
|
|
".",
|
|
"./base/midi-controller-plugin",
|
|
"./sequencer/sequencer",
|
|
"./arpeggiator/arpeggiator",
|
|
"./learn/learn-mode",
|
|
"./binding",
|
|
"./plugins/kontrol-s88",
|
|
"./plugins/maschine",
|
|
"./plugins/traktor-s4",
|
|
"./error-codes",
|
|
];
|
|
for (const path of required) {
|
|
expect(pkg.exports[path], `missing export: ${path}`).toBeDefined();
|
|
}
|
|
});
|
|
|
|
it("sideEffects is false", { timeout: 5000 }, () => {
|
|
expect(pkg.sideEffects).toBe(false);
|
|
});
|
|
});
|