Socket
Book a DemoInstallSign in
Socket

electron-ipc-mock

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-ipc-mock

Mocked electron ipc communication module

latest
Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
728
88.6%
Maintainers
1
Weekly downloads
 
Created
Source

electron-ipc-mock

Build Status Build Status

Mock Communication for Electron's IPC

An API mimicking Electron's ipcMain and ipcRenderer. Swap out electron calls in your code in tests to access both mock renderer and main process IPC communication calls.

Install

npm install electron-ipc-mock

Usage

const { ipcRenderer, ipcMain } = require('electron-ipc-mock')();

ipcMain.on('request', function (e, ...args) {
  console.log(args[0]); // 'hello'
  e.sender.send('response', 'world');
});

ipcRenderer.on('response', function (e, ...args) {
  console.log(args[0]); // 'world'
});

ipcRenderer.send('request', 'hello')

Testing

npm test

License

MIT License, Copyright (c) 2016 Jordan Santell

Keywords

electron

FAQs

Package last updated on 04 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts