From acc3dc06ef17707da08cbf64bc288cffa375b3cd Mon Sep 17 00:00:00 2001 From: huang47 <157390+huang47@users.noreply.github.com> Date: Wed, 8 Jul 2026 10:15:08 -0700 Subject: [PATCH] chore: add CodeRabbit litegraph test path instruction Move litegraph-only test guidance out of the blanket **/*.test.ts rule and into src/lib/litegraph/**/*.test.ts so unrelated Vitest files are not nudged toward litegraph factories or litegraph class mocking rules. The instruction also covers the DrJKL-style sparse-link cases from PR #13362: direct LGraph.configure() coverage for links: [null, validLink], direct compression coverage for compressWidgetInputSlots(), and avoiding helper-only coverage when a changed runtime path needs its own regression test. Verification: parsed .coderabbit.yaml with Ruby YAML and ran git diff --check. --- .coderabbit.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index a7437ac095..7eea449800 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -85,3 +85,11 @@ reviews: When a fixture cast hides a too-wide production signature, suggest narrowing the production type instead of casting the fixture. Flag process-level listeners (process.on('unhandledRejection')) in tests; assert the rejected promise directly. Tests should import the module under test from its public entrypoint, not deep internal paths. + - path: 'src/lib/litegraph/**/*.test.ts' + instructions: | + Treat `.agents/checks/test-quality.md`, `docs/testing/README.md`, and `docs/guidance/vitest.md` as required review context for every changed litegraph Vitest test file. + Reuse shared factories in `src/utils/__tests__/litegraphTestUtils.ts` instead of hand-rolling litegraph node, canvas, graph, subgraph, or workflow builders. + Flag mocked litegraph classes when a real instance or shared factory would exercise behavior directly. + When a PR changes litegraph graph deserialization, link loading, nullable serialized links, or sparse legacy link handling, require direct regression coverage for the changed runtime path. Helper-only coverage in a different utility is insufficient. + For `LGraph.configure()` sparse legacy links, expect a test that constructs an `LGraph`, calls `configure()` with a v0.4 payload containing `links: [null, validLink]`, asserts it does not throw, and asserts the valid link is still created. + For link-retargeting or widget-slot compression changes such as `compressWidgetInputSlots()`, expect a direct test of the compression path with `links: [null, validLink]` that proves the valid link is still retargeted while the null entry is ignored.