mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -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", () => ({
|
||||
|
||||
Reference in New Issue
Block a user