Files
2026-05-27 23:47:53 +01:00

33 lines
1.1 KiB
TypeScript

import { readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("tree-shake", () => {
it("sideEffects is false", { timeout: 5000 }, () => {
const pkg = JSON.parse(
readFileSync(join(__dirname, "..", "package.json"), "utf8")
) as { sideEffects?: boolean };
expect(pkg.sideEffects).toBe(false);
});
it("exports declares every engine subpath", { timeout: 5000 }, () => {
const pkg = JSON.parse(
readFileSync(join(__dirname, "..", "package.json"), "utf8")
) as { exports?: Record<string, unknown> };
const keys = Object.keys(pkg.exports ?? {});
for (const subpath of [
".",
"./tts/tts",
"./stt/stt",
"./voices/voices",
"./sound-effects/sound-effects",
"./voice-isolation/voice-isolation",
"./factory/create-elevenlabs-voice",
"./models/models",
"./speech-to-speech/speech-to-speech",
]) {
expect(keys).toContain(subpath);
}
});
});