Cover image for Javascript testing using WallabyJs

Javascript testing using WallabyJs

samueleresca profile image Samuele Resca ・2 min read

Javascript testing using WallabyJs

Javascript testing using Wallabyjs

Wallaby.js is insanely fast, because it only executes tests affected by your code changes and runs your tests in parallel.

javascript testing using wallabyjs Wallaby.js is a test runner for JavaScript, it can be integrated in most common code editors/IDE and it provides a productivity boost whether you are doing TDD and BDD. Wallaby.js is not free,  but it is less expensive than some similar commercial solutions for other languages.

The power of wallaby.js

The power of Wallaby.js is the integration between tests and code editor: it reports code coverage and test results and error while you're writing code.  Wallaby.js supports a lot of technologies, you can find a lot of samples and templates on github account.

Supported technologies

Wallaby.js supports continuous testing in most common code editor: Sublime text, Atom, Visual studio code, Visual Studio 2013/15 and WebStorm. ** It supports browser code testing (via **PhantomJS or node.js) and node.js testing, it also supports many testing frameworks, for example: Jasmine, Mocha, QUnit. Finally, tests can also be written using TypeScript or CoffeeScript.

Installation and Configuration

Wallaby.js  can be installed as an extension of your code editor: for example, in VS Code you can simply install using extension manager:

javascript testing using wallabyjs

Javascript testing using Wallaby.js needs a configuration file to work, recommended names are wallaby.js/wallaby.json or wallaby.conf.js. The following code shows some simple configuration options: https://gist.github.com/samueleresca/f2da5b0579403d81ff6f Here's the complete list of configuration options.

In my opinion..

Keep in mind,  Wallaby.js is not a file watcher: File watcher would run all of your JavaScript tests and it can be very time consuming. Wallaby uses dependency analysis and other tricks to only run tests affected by your code changes, no more no less, so even in large codebases with lots of tests the feedback is delivered very fast. I have tried Wallaby.js on two IDE: Visual studio 2013 and WebStorm 11. It has improved my TDD workflow, I think  it's very useful because it can jump to failing test, error sources, show error details inline. It has also been easy to import my testing code written on Mocha and Chai. Cheers :)

Posted on by:

samueleresca profile

Samuele Resca


Samuele Resca is an Microsoft MVP Visual Studio and Development Technologies, Software Engineer, specializing mainly on ASP.NET MVC and in general about everything that revolves around the web. Samuele was born in 1994, and works as a software developer @ YOOX NET-A-PORTER Group He loves the MVC frameworks, ASP.NET MVC, Javascript, Node.js and Typescript.


markdown guide