Runner and environment
Wallaby.js supports different environments including Google Chrome, node.js, Chromium/V8 via Electron and PhantomJs.
By default, your system’s PATH
node.js version is used as the test runner environment for testing frameworks running in node (such as Jest or Vitest), unless the node’s version has been overridden in your configuration. Google Chrome (headless) is used by default as the test runner environment for testing frameworks running in browser (such as Angular CLI Karma with jasmine or mocha).
You may use the env
configuration property to specify a path to a specific node or Chrome version, a different test runner or change the runner’s settings.
env.runner
env.runner
should be set to your local node/chrome/electron path, or just node
/chrome
(or any other command) that is mapped to your test runner binary. If it is not set, Wallaby will use the system’s PATH
one.
env.params.runner
env.params.runner
allows you to set space-separated spawned runner process flags.
env.params.env
env.params.env
allows you to set semicolon-separated spawned runner process environment variables.
env.type
env.type
should be set to 'node'
to use node.js, or set to 'browser'
to use a browser environment (PhantomJs or Electron). The default value is 'browser'
.
env.kind
env.kind
should be set to 'chrome'
to use locally installed Google Chrome as a test runner, or to 'electron'
to use Electron test runner, or set to 'phantomjs'
to use PhantomJs. The default value is 'chrome'
.
env.options
env.options
allows you to pass an object of Electron BrowserWindow options.
env.viewportSize
env.viewportSize
allows you to set PhantomJs/Electron page viewport size; the default value is {width: 800, height: 600}
.
env.report404AsError
The env.report404AsError
boolean property allows you to report any 404 server hits as errors to Wallaby Console; the default value is false
. It can be useful if you’d like to be alerted when your tests are requesting some missing resources or accessing missing server API, etc.