There are lots of ways to tests your JavaScript, but there is only one JsTestDriver

December 4th, 2009 · 10 Comments ·

Difference between JsTestDriver and other testing solution is the difference between flying economy and flying First Class. If you are serious about testing and TDD, than JsTestDriver is for you.

It is not another Assertion Framework
JsTestDriver as the name suggest, is not another assertion framework, but rather test runner. It can easily integrate with other assertion frameworks out there. There are already adapters for QUnit, and Yahoo Testing Frameworks, as well as Ruby autotest runner. We will help you integrate your favorite test runner.

JsTestDriver is blink of an eye fast. <angular/> is no small JavaScript project and it has about 300 unit tests and 10K lines of JavaScript. With JsTestDriver I can execute all of the tests on all major browser in under 400ms. That means that I run all of my tests on every save, giving me instantaneous feedback.

IDE Integration
It is nice to be able to run your unit tests in a browser but it is better to be able to run them from the the IDE. We have integration with Eclipse and InteliJ with instant run on every change. We even marshal the browser console into the IDE console for easier debugging.

Continuos Build Integration
If you are serious about testing, than you are serious about continuous integration. Because JsTestDriver can be controlled from the command line, it can easily integrate into your continuous build. Single command starts the browsers, runs the tests, and reports the test results in a XML file which is compatible with most continuos integration servers such as Hudson.

Code Coverage Built In
JsTestDriver allows JavaScript instrumentation on the fly, which means that it can instrument your code for coverage and generate LCOV format, which can be easily converted into source annotated report of your code. This is done transparently and works on all browsers.

Remote Test Execution
I develop on Mac, but need to test on IE. I run JsTestDriver on my build machine which can be accessed by HTTP and have IE always captured. No matter where I am in the world, I can run my tests against IE. This allows me to have a small browser farm ready to do my bidding.

Support form Mobile Browsers
Just as I can capture desktop browsers, I can also capture mobile browsers. This allows me to develop in my favorite IDE and have my tests run on every save on the mobile platform.

Tags: Uncategorized

10 responses so far ↓

  • Meza // Dec 4, 2009 at 8:33 am

    Do you know anything about netbeans integration?

  • misko // Dec 4, 2009 at 8:38 am

    Sorry, no NB integration in the works, but perhaps OS community could step in?

  • Chris // Dec 7, 2009 at 6:05 pm

    JsTestDriver slows down considerably or even kills the browser when running with JsTestCodeCoverage. The report generated by CodeCoverage is in linux format, therefore Windows users will have to find means to automate that process in order to turn the report into Windows format.

    Are there any chances that those issues be looked at soon?

  • misko // Dec 7, 2009 at 6:15 pm

    @Chirs, sorry for the trouble, but please file an issue here: and someone will look at it. I don’t work on JsTestDriver, I am just the guy who got the project going. Also email the mailing list.

  • Fonetik // Dec 8, 2009 at 1:56 pm



    -> “Continuous.”

    But I agree that’s ridiculous. Inglish shud fainli go fonetik too.

  • Chris // Dec 8, 2009 at 3:12 pm

    Thanks Misko. I have left a few issues there for a while now and didn’t get a response. I’ve spent quite some time trying to figure out how to solve those issues myself, and it would be great if I can get a helping hand from those who are working on it. Thanks.

  • Move over Java, I have fallen in love with JavaScript // Apr 7, 2010 at 9:20 pm

    [...] be second nature to you. I run all of my JavaScript tests on every save across most browser using JSTestDriver and all my tests execute under a second. This instant feedback on every save is as good as having [...]

  • @Lab « Tech Tock // Jul 9, 2010 at 4:31 am

    [...] surface, multi hundred project VS Solutions, JavaScript unit testing (jasmine, qunit, selenium, jstestdriver) , Advanced DataGrid [...]

  • geekraver // Oct 4, 2010 at 6:04 pm

    Has anyone got the code coverage to work? When using the conf file like in the wiki, I get an exception with 1.2.2:

    Exception in thread “main” java.lang.AbstractMethodError

    Also, I have tried JsTestDriver with iPhone/iPad and neither worked. It seems the tests fail on the command line before they complete on the device (I’m not sure that is what is happening but superficially it appears to be).

  • misko // Oct 5, 2010 at 5:21 pm

    @geekraver, please email the mailing list for JSTD related questions. I am sure that someone will help you there.