Google Releases Testacular a JavaScript Test Runner

Google engineers have created their own test running tool after dissatisfaction with existing tools for the purpose—a pretty common reason cited by new open source projects.

The new tool called Testacular aims to espouse three principles that Google believes any JavaScript test runner should, ‘it should be fast’, ‘it should use real browsers’, and it ‘should be reliable/stable’.

Google’s post announcing the new project explains why these principles are important. Many JavaScript test runners use non-browser-based JavaScript runtimes such as Node.js. Now, while Node.js uses the same JavaScript engine that is behind Google Chrome (V8) it does not supply the entire browser DOM, which makes it infeasible to use for projects such as Google-supported AngularJS, whcih heavily relies on DOM manipulation. Testacular can even perform tests on remote browsers, such as a browser on a mobile, tablet, or even a gaming console.

Even so, Testacular itself runs on Node.js and Socket.IO. Now, it is important to know that Testacular isn’t itself a testing framework, nor does it provide one. It does provide adapters for Mocha and Jasmine though, which are popular testing frameworks.

Another common principle behind most Google developments is speed, so it isn’t surprising that it is a core focus of Testacular. The test runner watches your project directory for changes and runs automatically on changed files, so you cna get instant feedback.

As for stability and reliability, Testacular is supposed to run for days without restarting, and aims to avoid getting into an inconsistent state as older test running tools would.

Google’s new project is open source, and available—quite oddly—on GitHub rather than Google’s own Google code service.

If you are interested in this new testing library, you can check out the video below:

Leave a Comment

Your email address will not be published. Required fields are marked *