Meteor Desktop Plugin Test Suite
Few utils to ease out functional testing of Meteor Desktop plugins.
getElectronPath
Returns path to electron bin.
createTestApp(installPath, pluginName)
Creates a test app with the your plugin included.
The test app provides two methods through accessible through IPC.
-
constructPlugin
params log, app, appSettings, systemEvents, modules, settings
It is just constructing your plugin. Pass undefined
if your plugin does not use certain param.
-
fireSystemEvent
params systemEvent, ...args
Fires an system event, so you can simulate a systemEvent on which you plugin is listening. You need to pass undefined
as systemEvents
params to make this work.
sendIpc(app, ...args)
Sends an IPC message to the main process. You can use constructPlugin
sendModuleEvent(app, module, event, ...args)
Sends an IPC event to your module.
Use if your plugin/module registers itself via let module = new Module('myModuleName')
.
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.
Example
An example of usage in tests is here meteor-desktop-splash-screen