Introducing Google JS Test
Posted:
Thursday, September 29, 2011
Google JS Test is a JavaScript unit testing framework that runs on the V8 JavaScript Engine, the same open source project that is responsible for Google Chrome’s super-fast JS execution speed. Google JS Test is used internally by several Google projects, and we’re pleased to announce that it has been released as an open source project.
Features of Google JS Test include:
By Aaron Jacobs, Google Engineer
Features of Google JS Test include:
- Extremely fast startup and execution time, without needing to run a browser.
- Clean, readable output in the case of both passing and failing tests.
- An optional browser-based test runner that can simply be refreshed whenever JS is changed.
- Style and semantics that resemble Google Test for C++.
- A built-in mocking framework that requires minimal boilerplate code (e.g. no $tearDown or $verifyAll calls), with style and semantics based on the Google C++ Mocking Framework.
- A system of matchers allowing for expressive tests and easy to read failure output, with many built-in matchers and the ability for the user to add their own.

By Aaron Jacobs, Google Engineer

Hi,
ReplyDeleteCould you please explain if there's a link with js-test-driver?
Cheers,
Pablo
>September 2011
ReplyDelete>New open-source JS project not hosted on GitHub
>not hosted on GitHub
What? Seriously?
Code dumps is not "Open Source".
ReplyDeleteCheers.
Does this test arbitrary JS code, or does it test JS implementations, such as browsers?
ReplyDeleteA simple question, but the description isn't clear.
Mind telling us what the font used in the screenshot is?
ReplyDelete@rgln: There is no link, except that both were created by teams at Google. JsTestDriver is for testing code in lots of different browsers. Google JS Test is more for really fast, convenient execution in a single JS engine, along with nice features like matchers and mocking.
ReplyDelete@t50: Keep in mind that it's still a git repo; you're free to clone it and put a fork on GitHub if you want.
@David_Spector: This is for testing arbitrary JS code, i.e. the code that you write, not JS implementations. Anybody can download this and write tests for their own code.
Why does could reinvent everything instead of supporting existing open source like QUnit and sinon?
ReplyDeleteI'm sure internally - if it's not from Google it doesn't exist, right?
@Craig: Drop the whining. Don't like it? Don't use it.
ReplyDelete@Craig: QTest and Sinon are Javascript libraries that run inside of a browser to unit test your code. This looks like it is a Javascript engine - the one from Chrome - that has some stuff added to it to allow testing of your code without needing to run it in a browser. This means you can plug it into your CI environments and the like trivially...
ReplyDeleteYou could possibly use Sinon or QTest inside of this if you wanted to, but this already has some similar tools to what they provide...