.agents/skills/tests-unit-preload/SKILL.md
Guides how to design, implement, and validate high-value unit tests for preload bridge contracts, renderer-facing exposures, and IPC delegation behavior with clear boundaries and deterministic collaborator doubles.
npx skillsauth add esplotter/esplotter tests-unit-preloadInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run with: npm run test:unit:preload
This skill defines how to test preload bridge contracts that connect renderer and IPC. It standardizes where tests live, what contract behavior must be covered, how to isolate Electron runtime dependencies, and how to report outcomes so reviews stay fast and objective.
Canonical policy source: docs/testing/tests.md.
Local layout/context source: docs/testing/tests.md.
contextBridgeExposeInMainWorld(...).ipcRendererInvoke(...) and ipcRendererOn(...).tests-unit-main.tests-unit-main-infrastructure.tests-unit-renderer.tests-components.tests-e2e.render(...), renderHook(...), DOM queries, interaction events) in this suite.*.preload.spec.ts.should ... format.src/test/preload/src/test/preload/preload.<namespace>.preload.spec.tsversions, files, userPreferences, clipboard).preload.preload.spec.ts files.src/test/preload/mocks/<CollaboratorName>Mock.tssrc/test/preload/shared/<FixtureName>Fixture.tscontextBridgeExposeInMainWorld, ipcRendererInvoke, ipcRendererOn) over Electron internals directly.<CollaboratorName>Mock.ts naming.set* / given*fail* / willFailWith*expect* (throwing descriptive errors)vi.resetModules, mock resets, shared maps cleanup).should ... convention.*.preload.spec.ts naming under src/test/preload/.npm run test:unit:preload passes.npm run test:unit:preloadReturn a structured YAML report including:
status: ok | needs_clarification | errorsummary: what was tested/changed in one paragraphfiles_changed: list of changed pathstests_added_or_updated: list of test files added/updatedmocks_added_or_updated: list of mock files added/updatedcommands_run: commands executed (at minimum npm run test:unit:preload when applicable)result:
passed: booleanfailed_tests: listerror_excerpt: short excerpt when failingquestions: open questions with reason when clarification is needednext_actions: recommended follow-up actionswarnings: risks, assumptions, or deviationsdevops
Applies consistent renderer UI/UX implementation patterns using a Vercel-inspired white theme, strong accessibility defaults, and repository component conventions.
development
Use this first for any task that changes behavior or tests. This is a test strategy and routing skill, it selects the right test-suite skill(s), defines when to escalate coverage (for example e2e/compiled parity), and enforces regression rules.
tools
Guides how to design, implement, and validate high-value unit tests for renderer pure logic (stores, selectors, mappers, and utility flows) with strict no-DOM boundaries and deterministic contract assertions.
testing
Guides how to design, implement, and validate high-value unit tests for preload bridge contracts, renderer-facing exposures, and IPC delegation behavior with clear boundaries and deterministic collaborator doubles.