Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(skills): add coverage-masking, hanging-spec and logcat gotchas
Elian Doran526d7685572d
diff --git a/.claude/skills/ckeditor5-reviewing/references/defect-patterns.md b/.claude/skills/ckeditor5-reviewing/references/defect-patterns.mdindex 15ad51b6a3..e70e910e04 100644--- a/.claude/skills/ckeditor5-reviewing/references/defect-patterns.md+++ b/.claude/skills/ckeditor5-reviewing/references/defect-patterns.md@@ -205,6 +205,23 @@ variants, all of which render fine in English and are never translated anywhere:schema-disallowed; tear down. Tests are **Vitest** with real `ClassicEditor.create` and helpersfrom `ckeditor5`; run them via `pnpm --filter @triliumnext/ckeditor5 test`.+**Coverage that certifies a bug instead of catching it.** The aggregate is gated at 100 %, so the+incentive is to make a line *covered*, not correct — and a review that trusts the number misses+what the number is hiding.+- Spot: a `/* v8 ignore */` over a block described as unreachable; a spec asserting `.toThrow()`+ on the plugin's own happy path; a spec that re-implements the helper it claims to test instead of+ calling it; a spec whose only assertions are shape (`expect(arr).toHaveLength(3)`) and which never+ names the behavior under test; a module whose sole consumer is its own spec.+- Why: each of these has happened in-tree. An `inputTransformation` handler registered on+ `Clipboard` instead of `ClipboardPipeline` — so it never fires in production — carried a+ `v8 ignore` comment *documenting* it as unreachable while its spec asserted `.toThrow()`, locking+ in a triple bug (wrong event, wrong payload field, an upcast that never matched). A leveled+ logger's ignore comment covered the one branch that does run, leaving two permanent no-ops. A+ view class stayed alive only because its spec imported it.+- Fix: read every `v8 ignore` and every `.toThrow()` as a claim to verify. An ignore comment must+ justify why the path *cannot* be reached, not record that it currently isn't; a `.toThrow()` must+ test a documented error contract, not observed brokenness. Dead code gets deleted, not covered.+## Trilium integrationThe monorepo wiring and conventions — a plugin can be internally correct yet still broken becausediff --git a/.claude/skills/developing-capacitor-mobile/SKILL.md b/.claude/skills/developing-capacitor-mobile/SKILL.mdindex ad2bc97861..1e990926ae 100644--- a/.claude/skills/developing-capacitor-mobile/SKILL.md+++ b/.claude/skills/developing-capacitor-mobile/SKILL.md@@ -71,6 +71,12 @@ pnpm --filter @triliumnext/mobile run:ios | open:ios # Xcode (macOS)CI: `mobile.yml` (pull requests) builds a debug APK via `.github/actions/build-mobile` and an unsigned iOS **Simulator** `.app` on macOS; `nightly.yml` calls the same action with `nightly: "true"` for the signed `assembleRelease` build under the `.nightly` app id. Neither runs unit tests — those live in the standalone suite.+**Debugging on a device:** a *release*-type build (what `nightly.yml` produces) suppresses WebView+console→logcat forwarding, so anything logged from JS is invisible to `adb logcat` and log-based+detection of what the app is doing goes blind. `android.util.Log` calls from the native side still+come through, so instrument the Java layer — or install a debug build — when you need to see what+is happening.+## TestingEverything JS-side is under the standalone Vitest suite (happy-dom + real sqlite-wasm):diff --git a/.claude/skills/writing-unit-tests/SKILL.md b/.claude/skills/writing-unit-tests/SKILL.mdindex 489a41144a..98c84188c0 100644--- a/.claude/skills/writing-unit-tests/SKILL.md+++ b/.claude/skills/writing-unit-tests/SKILL.md@@ -89,3 +89,10 @@ coverage: {vi.setConfig({ testTimeout: 60000, hookTimeout: 60000 });}```+- **A spec that hangs at *exit* takes the whole suite down with it.** An unclosed timer, `ResizeObserver`, event listener or in-flight `fetch` can let every test pass and then stop Vitest from exiting — which hangs the full `pnpm test` run, and CI with it. Because the failure is at teardown, the spec looks green in isolation. Diagnose by sweeping the specs one at a time under a hard timeout and looking for exit code 124:++ ```bash+ find <dir> -name '*.spec.tsx' | xargs -P6 -I{} timeout 70 <vitest> run {}+ ```++ Use **absolute paths** in that command — a background shell starts at the repo root, not wherever you last `cd`'d. Clean up the handle in the spec rather than raising the timeout.