feat(tools)!: SnapOtter 2.0 phase 4 wave 1: 45 core tools across all modalities (#219)

This commit is contained in:
SnapOtter
2026-06-13 10:18:49 +08:00
parent d647d8ed19
commit ae1337901d
115 changed files with 10026 additions and 924 deletions
+13
View File
@@ -26,6 +26,19 @@ describe.skipIf(!ffmpegAvailable())("MediaInputHandler (requires ffmpeg)", () =>
).rejects.toThrow(InputValidationError);
});
it("rejects a still image presented as video", async () => {
const buf = await readFile(join(process.cwd(), "tests/fixtures/test-1x1.png"));
await expect(
new MediaInputHandler("video").prepare(buf, "fake.mp4", { scratchDir }),
).rejects.toThrow(/still image/i);
});
it("accepts a real video despite short duration", async () => {
const buf = await readFile(join(process.cwd(), "tests/fixtures/media/tiny.mp4"));
const out = await new MediaInputHandler("video").prepare(buf, "tiny.mp4", { scratchDir });
expect(out.filename).toBe("tiny.mp4");
});
it("enforces the duration cap", async () => {
const { env } = await import("../../apps/api/src/config.js");
const original = env.MAX_AUDIO_DURATION_S;