Skip to content

Commit 479bf2f

Browse files
committed
chore: add CodeRabbit shared test builder instruction
Covers the DrJKL PR #13362 feedback for hand-rolled LiteGraph node, canvas, workflow, and subgraph builders in app, pnginfo, subgraphService, and vintageClipboard tests. Verified with: ruby -e 'require "yaml"; YAML.load_file(".coderabbit.yaml")' and git diff --check.
1 parent bd6066f commit 479bf2f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.coderabbit.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ reviews:
126126
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.
127127
Reuse shared factories in `src/utils/__tests__/litegraphTestUtils.ts` instead of hand-rolling litegraph mock builders.
128128
Flag mocked litegraph classes when a real instance or shared factory would exercise behavior directly.
129+
- path: '{src/scripts/app.core.test.ts,src/scripts/pnginfo.test.ts,src/services/subgraphService.test.ts,src/utils/vintageClipboard.test.ts}'
130+
instructions: |
131+
Flag local fixture builders such as `createMockNode`, `createMockCanvas`, `createNode`, `createCanvas`, `createWorkflow`, or `createExportedSubgraph` when they recreate LiteGraph nodes, canvases, workflows, or subgraphs that existing shared helpers already provide.
132+
Prefer shared helpers from `src/utils/__tests__/litegraphTestUtils.ts`, `src/utils/__tests__/executionErrorTestUtils.ts`, or subgraph fixtures. A wrapper is acceptable only when it delegates to the shared helper and adds meaningful domain-specific behavior.
129133
- path: 'src/services/litegraphService*.test.ts'
130134
instructions: |
131135
When tests replace browser-owned descriptors such as `navigator.clipboard`, verify the original descriptor is saved and restored. `vi.unstubAllGlobals()` does not restore descriptors changed with `Object.defineProperty`.

0 commit comments

Comments
 (0)