By default, wallaby.js uses Google Chrome (headless) as its test runner. It also supports Node.js, Electron and PhantomJs.
All you have to do to run your tests in Electron, is to install Electron for your platform:
npm install electron --save-dev
and specify kind: 'electron'
in your env
setting in wallaby config:
module.exports = function () {
return {
files: [
...
],
tests: [
...
],
env: {
kind: 'electron'
}
};
};
You may also use an absolute or a relative path (or a command if you have it in PATH
). It may be useful if you would like to install the module globally or have the executable somewhere else inside or outside of your project.
module.exports = function () {
return {
files: [
...
],
tests: [
...
],
env: {
kind: 'electron',
runner: '/Users/user/path/to/electron'
}
};
};
Passing Electron BrowserWindow options
You may pass BrowserWindow options, that wallaby.js will use to create the window to run your tests in, by using env.options
setting, for example:
module.exports = function () {
return {
files: [
...
],
tests: [
...
],
env: {
kind: 'electron',
options: { width: 400, height: 400 }
}
};
};