BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Google Open Sources Testacular, a JavaScript Test Runner

by Abel Avram on Nov 28, 2012 |

Google has open sourced Testacular, a JavaScript test runner based on Node.js. The tool can be used to test all major web browsers, can be integrated with CI tools, and it works with any code editor.

Testacular runs JavaScript code tests on various desktop or mobile device browsers, locally, on a device or on a continuous integration server. Testacular supports Chrome, ChromeCanary, Safari, Firefox, IE, Opera, PhantomJS, and knows how to capture the browsers using default paths which can be overridden in the launcher configuration files. Testacular is just a test runner being able to work with various testing frameworks, having adapters for Jasmine, Mocha and AngularJS. It can also be integrated with Jenkins or Travis for running continuous integration tests.

One of the power features of this testing tool is the ability to monitor a set of files for changes and immediately initiate tests on a saved file without the user having to leave the text editor. The test results are usually displayed at the command line and not within the code editor, making Testacular able to work basically with any JavaScript editor. For better results, it can be integrated with WebStorm which provides stack trace for errors and unit test debugging support.

In order to run, Testacular needs Node.js and a configuration file containing information regarding the files to be tested, those to be ignored, base path, web server port, logging level, etc. (A configuration file sample.)

Regarding its performance, Vojta Jína, a Google engineer, has demoed running about 1,500 AngularJS tests in WebStorm against Chrome Canary and Chrome in less than 5 seconds.

Jína wrote that Testacular was inspired by JS Test Driver, but they decided to write a different test runner due to the “many problems [they had] with JSTD”, wanting “a simple tool just for executing JavaScript tests that is both stable and fast. That's why we use the awesome Socket.io library and Node.js.”

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

What a name! by Thiébaut Champenier

So manly you can’t forget it!

So after running a set of tests based on this.... by Porter Woodward

Does my test run report rank my application's Testacular Fortitude as a rating of test coverage?

Microsoft immediately responded by releasing Ovarial by Shai Almog

test incubation solution. Oracle plans to release Vasectomal over the next few days but is having trouble shooting to the deadline.

you can' make this stuff up by Richard Johnson

Framework author is

V. Jina

LOL

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

4 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT