test: add unit test for calibre.ts

This commit is contained in:
Jörg Krzeslak 2025-07-24 11:24:12 +02:00
parent 301fab5c17
commit fd4e73e76c
5 changed files with 116 additions and 73 deletions

View file

@ -0,0 +1,19 @@
import { test } from "bun:test";
import { convert } from "../../src/converters/calibre.ts";
import {
runConvertFailTest,
runConvertLogsStderror,
runConvertSuccessTest,
} from "../helpers/converters.test.ts";
test("convert resolves when execFile succeeds", async () => {
await runConvertSuccessTest(convert);
});
test("convert rejects when execFile fails", async () => {
await runConvertFailTest(convert);
});
test("convert logs stderr when present", async () => {
await runConvertLogsStderror(convert);
});