tests-unit-preload

Standardize unit-test contracts for Electron preload bridges and IPC delegation.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/ESPlotter/ESPlotter --skill tests-unit-preload
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tests-unit-preload
Source: https://github.com/ESPlotter/ESPlotter/tree/main/.github/skills/tests-unit-preload
Command: npx skills add https://github.com/ESPlotter/ESPlotter --skill tests-unit-preload

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Preload testing for Electron apps is error-prone without a standardized contract; this Skill defines a reusable blueprint to validate preload bridges, IPC delegation, and renderer exposure with deterministic collaborator doubles.

Core Features & Use Cases

  • Consolidated contract-driven testing for preload exposures, wrappers around ipcRendererInvoke, and contextBridge bindings.
  • Deterministic mocks and fixtures that isolate the Electron runtime and prevent DOM or renderer side effects.
  • Clear file-layout and naming conventions for scalable, repeatable tests across multiple preload namespaces.

Quick Start

Run npm run test:unit:preload to execute the preload contract tests.

Frequently Asked Questions about tests-unit-preload

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I unit test Electron preload contextBridge exposures?

Unit test Electron preload contextBridge exposures by standardizing contract tests for preload bridges, IPC delegation, and renderer exposure using deterministic mocks and named spec patterns like *.preload.spec.ts.

How do I mock ipcRenderer wrappers in Electron preload unit tests?

Mock ipcRenderer wrappers in Electron preload unit tests by isolating the Electron runtime with deterministic collaborator doubles and fixtures, preventing DOM or renderer side effects during contextBridge bindings validation.

What is the best way to structure Electron preload test files for scalable IPC contract testing?

Structure Electron preload test files using a standardized layout under src/test/preload with dedicated mocks and fixtures, ensuring repeatable IPC contract testing across multiple preload namespaces.

Can I run isolated preload tests without triggering Electron runtime side effects?

Yes, you can run isolated preload tests without triggering Electron runtime side effects by using deterministic mocks and fixtures that isolate the runtime, executed via the npm run test:unit:preload command.

Why do my Electron preload tests fail due to unclear contextBridge boundaries?

Electron preload tests fail due to unclear contextBridge boundaries because without standardized contracts for IPC delegation and event channel mappings, test isolation breaks and renderer side effects occur.