tl;dr: Check the Socialize JS Testing Framwork Out on GitHub

At Socialize we believe that it is hard to move a product forward if those developing for it are constantly looking backwards chasing down bugs. Lacking the confidence that each change made to the code base will not create new problems elsewhere pulls innovation for a product in a technology company to a screeching halt. As such, our head engineer Jason has pushed hard to create and drive a deep testing culture here. Our SDK has thousands of tests running continuously through our build server, those running tests monitor code  functionality as well as analyze our code base for code coverage (lines of code covered by tests). The results are fed into heads up display at the office keeping our “test stats” top-of-mind.

This approach works well for established development environments with mature testing tools, but one area that is often overlooked is common-place websites.  With more and more emphasis on Javascript-heavy web apps the need for an automated testing environment is becoming increasingly apparent.  Often this problem is solved by using some form of browser automation like Selenium and this is great for performing integration tests on the final product, but what about good old unit tests?

Thankfully some time ago the folks at Yahoo developed a testing system for Javascript which formed part of their YUI toolset.  As awesome as this toolset is, it lacks a simple interface to report on the outcome of tests.. so we built one.

The js-test-suite system is a web based runner for Javascript tests based on the YUI test system which both executes the tests in a suite, and renders the results (tests passed, reasons for test failures, and an overall count of both) to a simple web page. The tool also incorporates JSLint test execution which (particularly in a JS environment) will catch several problems in your code that may not be apparent from broader integration test scenarios. This web page can then be easily displayed or parsed into our heads-up display system at our office. The tool is packaged up and documented so that anyone interested in adding this awesome test suite to their project can do so by simply changing a few configuration settings.

Here is an example of what our JS testing dashboard looks like when it’s run:

 Visit our GitHub page to get the JS framework code!

Leave a Reply