In association with heise online

30 September 2011, 15:50

Google open sources JavaScript unit testing framework

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

Zoom Google JS Test in action
Source: Google
On the Open Source at Google blog, Google has announced the release of JS Test – the JavaScript unit testing framework that it uses in-house – as an open source project. The tests run on Google's V8 JavaScript engine, the same open source JavaScript engine used in Google's Chrome web browser. In developing JS Test, the creators of the framework were inspired by googletest, an open source framework for writing C++ unit tests.

Aaron Jacobs, Google Engineer, says that JS Test has an "extremely fast startup and execution time" and doesn't need a browser to run. It is possible to use a test runner in a browser; the test runner can simply be refreshed when changes have been made to the JavaScript code. JS Test also contains a built-in mocking framework for the isolated testing of individual test objects; its style and semantics are also based on the googletest mocking framework.

The project's web site points out that the tool cannot easily be used to test code with DOM (Document Object Model) functions, which greatly limits the use of JS Test for classic web applications. In contrast, the tool seems to be well-suited for testing code that does not depend upon DOM-specific and other browser-specific functions, such as window and document, for instance, it can be used on server and console applications based on the server-side Node.js JavaScript framework.

The current release of JS Test is version 1.0.4. Hosted on Google Code, JS Test is made available under the Apache License 2.0.


Print Version | Send by email | Permalink:

  • July's Community Calendar

The H Open

The H Security

The H Developer

The H Internet Toolkit