Files
SubMiner/backlog/tasks/task-2.4 - Add-tests-for-anki-jimaku-service.md
2026-02-17 22:54:09 -08:00

1.6 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, references, parent_task_id, ordinal
id title status assignee created_date updated_date labels dependencies references parent_task_id ordinal
TASK-2.4 Add tests for anki jimaku service Done
codex
2026-02-10 18:56 2026-02-18 04:11
TASK-2.1
investigation.md
src/core/services/anki-jimaku-service.ts
TASK-2 7000

Description

Add dedicated tests for anki-jimaku-service.ts focusing on IPC handler registration, request dispatch, and error handling behavior.

Acceptance Criteria

  • #1 IPC registration behavior is validated for all channels exposed by this service.
  • #2 Success-path behavior for core handler flows is validated.
  • #3 Failure-path behavior is validated with expected error propagation.
  • #4 pnpm run test:core remains green.

Implementation Notes

Added a lightweight registration-injection seam to registerAnkiJimakuIpcRuntimeService so runtime behavior can be tested without Electron IPC globals.

Added src/core/services/anki-jimaku-service.test.ts with coverage for:

  • runtime handler surface registration
  • integration disable path and runtime-options broadcast
  • subtitle history clear and field-grouping response callbacks
  • merge-preview guard error and integration success delegation
  • Jimaku search request mapping/result capping
  • downloaded-subtitle MPV command forwarding

Updated package.json test:core to include dist/core/services/anki-jimaku-service.test.js.

Verification: pnpm run test:core passed (21/21).