electron/*.cjs has zero coverage: Vitest only includes src/**, and tsc doesn''t check the CJS files, so main-process logic is the one part of the app where regressions ship blind. It''s no longer trivial logic either: fork resolution and discovery (loadForkFromDir, handleDiscoverForks), the settings round-trip, path-containment checks in the app:// file serving, and the unsaved-close guard.
- Extract the pure logic (fork test, discovery scan, path containment, MIME mapping) into a requireable module that both
main.cjs and Vitest can load; keep the Electron-API wiring thin.
- Unit-test the extracted logic; the path-containment ("never serve outside dist/ or the fork root") checks are the ones that most deserve tests.
- Full Electron integration tests (spectron-style) are out of scope; this is about the logic, not the shell.
electron/*.cjshas zero coverage: Vitest only includessrc/**, andtscdoesn''t check the CJS files, so main-process logic is the one part of the app where regressions ship blind. It''s no longer trivial logic either: fork resolution and discovery (loadForkFromDir,handleDiscoverForks), the settings round-trip, path-containment checks in theapp://file serving, and the unsaved-close guard.main.cjsand Vitest can load; keep the Electron-API wiring thin.