Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
meteor-desktop-plugin-test-suite
Advanced tools
Few utils to ease out functional testing of Meteor Desktop plugins.
Few utils to ease out functional testing of Meteor Desktop plugins. Take a look at the examples at the bottom of this readme to actually see how you can use this.
getElectronPath
Returns path to electron bin.
createTestApp(installPath, pluginName)
Creates a test app with plugin you are testing included. Plugin is installed by npm
.
/**
* @param {string} installPath - path at which to install the app
* @param {string} pluginName - name of the npm package (plugin) you are testing
* @returns {Promise}
*/
constructPlugin(app, log, app, appSettings, eventsBus, modules, settings, Module)
It is instantiating your plugin. You can supply mocks for any params your plugin would normally receive from the skeleton app.
Pass undefined
if your plugin does not use certain param or if you want to use some defaults provided by this test suite. Check here to see what is passed by default.
fireEventsBusEvent(app, eventToFire, ...eventArgs)
Fires an event on the events bus, so you can simulate for example a system event on which you plugin is listening.
/**
* @param {Object} app - app ref from Spectron
* @param {string} eventToFire - name of the event to fire
* @param {...*} eventArgs - arguments to pass with the event
* @returns {Promise}
*/
send(app, module, event, ...args)
Sends an IPC event to your module. Equivalent of Desktop.send
.
/**
* @param {Object} app - app ref from Spectron
* @param {string} module - module name your plugin is registering
* @param {string} event - event from your module
* @param {...*} args - array of arguments to pass to ipc.send
* @returns {Promise}
*/
fetch(app, module, event, ...args)
Fetches some data from main process by sending an IPC event and waiting for the response.
Equivalent of Desktop.fetch
.
/**
* @param {Object} app - app ref from Spectron
* @param {string} module - module name your plugin is registering
* @param {string} event - event from your module
* @param {...*} args - array of arguments to pass to ipc.send
* @return {Promise}
*/
fireEventsBusEventAndWaitForAnother(app, eventToFire, eventToListenFor, ...eventArgs)
Fires an event on the events bus and then waits for an another event to be emitted. Useful for example when your plugin is doing some stuff on afterLoading
event and signalizes readiness via another event.
/**
* @param {Object} app - app ref from Spectron
* @param {string} eventToFire - name of the event to fire
* @param {string} eventToListenFor - event to listen for on the events bus
* @param {...*} eventArgs - arguments to pass with the event
* @return {Promise}
*/
sendIpc(app, ...args)
Sends an IPC message to the main process.
/**
* @param {Object} app - the app ref from Spectron
* @param {...*} args - array of arguments to pass to ipc.send
* @returns {Promise}
*/
sendIpcSync(app, ...args)
Same as above but sync. However also returns a Promise
as it is transferred through chromedriver.
sendIpcAndWaitForResponse(app, eventToSend, eventToListenFor, ...eventArgs)
Sends an IPC event and waits for an another IPC event to come.
/**
* @param {Object} app - app ref from Spectron
* @param {string} eventToSend - name of the ipc event to send
* @param {string} eventToListenFor - ipc event to listen for
* @param {...*} eventArgs - arguments to pass with the event
* @returns {Promise}
*/
class Logger(show, showErrors)
Fake logger that eventually can write the logs to the console. You can set show
to false
and showErrors
to true
to only see errors passed to it.
An example of usage in tests is here meteor-desktop-splash-screen and here meteor-desktop-localstorage.
FAQs
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.
The npm package meteor-desktop-plugin-test-suite receives a total of 0 weekly downloads. As such, meteor-desktop-plugin-test-suite popularity was classified as not popular.
We found that meteor-desktop-plugin-test-suite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.