node.js - Avoiding EADDRINUSE when using wallaby.js with an express project -


i've had great luck using wallaby.js on client side javascript , i'd try work on server side javascript. however, wallaby.js likes spin lot of parallel web servers causes problems tests because keeps on throwing eaddrinuse errors.

the basic scaffolding of project done yeoman angular-fullstack generator, server code sits in /server , of methods in /server/api.

thus far, i've managed kinda work following configuration:

module.exports = function () {   return {     files: [       'server/**/*.js',       { pattern: 'server/**/*.spec.js', ignore: true }     ],      tests: [       'server/**/*.spec.js'     ],      env: {       type: 'node',      },      debug: true,     workers: {       initial: 1,       regular: 1,       recycle: false     }   }; }; 

here can see i'm setting number of wallaby workers 1 , not allowing recycle workers. works fine first time through, after start edit files occasional eaddrinuse errors.

is there preferred mechanism using wallaby.js express , avoiding spawning multiple test server processes on same port, thereby eliminating eaddrinuse errors?

the name bit confusing, recycle: true trick. recycle: false means once started node processes reused forever.

i understand it's not possible use parallel processes (especially db tests), make work web server, may specify 0 port when running tests, it'll pick , use random one.

  var server  = require('http').createserver();   server.listen(0); 

this way wallaby able run tests in parallel , reuse processes.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -