Initial Commit
This commit is contained in:
40
packages/media/audio/audio-controllers/tests/exports.test.ts
Normal file
40
packages/media/audio/audio-controllers/tests/exports.test.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user