Generate mocks for Electron APIs (ipcMain, ipcRenderer, dialog, etc.) for unit testing
Generates mock implementations of Electron APIs for unit testing without requiring the actual Electron runtime.
npx claudepluginhub a5c-ai/babysitterThis skill is limited to using the following tools:
README.mdGenerate mocks for Electron APIs to enable unit testing of main and renderer process code without running Electron.
{
"type": "object",
"properties": {
"projectPath": { "type": "string" },
"testFramework": { "enum": ["jest", "vitest", "mocha"] },
"modulesToMock": { "type": "array" }
},
"required": ["projectPath"]
}
// __mocks__/electron.js
module.exports = {
app: {
getPath: jest.fn(name => `/mock/${name}`),
getVersion: jest.fn(() => '1.0.0'),
quit: jest.fn(),
on: jest.fn()
},
ipcMain: {
on: jest.fn(),
handle: jest.fn(),
removeHandler: jest.fn()
},
ipcRenderer: {
on: jest.fn(),
send: jest.fn(),
invoke: jest.fn()
},
dialog: {
showOpenDialog: jest.fn(() => Promise.resolve({ filePaths: [] })),
showSaveDialog: jest.fn(() => Promise.resolve({ filePath: undefined })),
showMessageBox: jest.fn(() => Promise.resolve({ response: 0 }))
},
BrowserWindow: jest.fn().mockImplementation(() => ({
loadURL: jest.fn(),
on: jest.fn(),
webContents: { send: jest.fn(), on: jest.fn() }
}))
};
jest.mock('electron');
const { ipcRenderer } = require('electron');
test('sends message', () => {
myModule.sendMessage('hello');
expect(ipcRenderer.send).toHaveBeenCalledWith('channel', 'hello');
});
playwright-electron-configdesktop-unit-testing processActivates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.