Configuration file: Workers

The workers object property specifies the degree of parallelism used to run your tests and controls the way wallaby.js re-uses workers. It’s recommended to skip setting the property and leave it up to wallaby.js to decide how many processes to use based on your system capacity, until you actually encounter a case when you think tuning the workers count may help.

 module.exports = function () {
   return {
     files: [
       'src/**/*.js'
     ],

     tests: [
       'test/**/*Spec.js'
     ],

     workers: {
       initial: 6,
       regular: 2
     }
   };
 };

The initial numeric property specifies the number of parallel processes to use to run your tests when your start/restart wallaby.js.

The regular numeric property specifies the number of parallel processes to use to run your tests every time your code changes.

The restart boolean property determines whether wallaby.js should restart workers. (When set to true, wallaby.js will restart processes for each run; When set to false, wallaby.js will forever keep using processes that were started once, relying on your test cleanup code). The property is only applicable in a node.js environment, as in the browser environment wallaby.js reloads the page anyway.

For example, the configuration sample above makes wallaby.js run all tests in 6 separate workers initially, then use up to 2 workers to run tests on your code changes.

If your tests depend on each other in some way and you would not like to, or cannot, make them isolated, you may set initial and regular properties to 1. This will make wallaby run all of your tests sequentially like in other test runners, like Karma or Mocha/Jasmine runner.