fix(api): drop app-logger import from media-input; update stale errors mock

The full unit suite surfaced two issues from earlier commits on this branch. (1) Importing the app logger into media-input.ts pulled logger.ts -- which builds its pino file transport at module load via join(env.LOG_DIR, ...) -- into the unit-test import graph, throwing at collection time wherever LOG_DIR is unset (integration tests set it; unit tests do not). A low-level modality handler should not depend on the app logger, and a corrupt upload is an expected user error, so drop the import and keep the clean validation message. (2) tool-factory-route.test.ts mocked errors.js without the new friendlyError export; add it.
This commit is contained in:
SnapOtter
2026-06-17 14:28:41 +08:00
parent 9c250d244f
commit c483897452
2 changed files with 5 additions and 4 deletions
@@ -124,6 +124,7 @@ vi.mock("@snapotter/doc-engine", () => ({
vi.mock("../../../apps/api/src/lib/errors.js", () => ({
formatZodErrors: (issues: Array<{ message: string }>) => issues.map((i) => i.message).join("; "),
stripInternalPaths: (msg: string) => msg,
friendlyError: (msg: string) => msg,
}));
vi.mock("sharp", () => ({