Gerbil, Smoking, URI.js

2012-01-02 00:00:00 +0000 by Alex R. Young


Gerbil (npm: gerbil) by Bruno Aguirre is a test framework for both Node and client-side development. Tests are structured in a BDD-like style, and assertions are included. It's a small library but it offers a quick way to get started writing tests without many dependencies. I noticed that tests asynchronous code is supported because tests are run against a timeout, but there doesn't appear to be an explicit "this test is finished" method call to directly support asynchronous code.

Tests with Gerbil look like this:

scenario('This is a group of tests', {
  'should assert true': function(g) {


Smoking (npm: smoking), also by the same author, is a mocking and stubbing library. Prototype classes can be stubbed, and then expectations can be defined:


When verify fails an exception will be raised, so this should be handled by most testing libraries.


URI.js (GitHub: medialize / URI.js, License: MIT and GPL v3) by Rodney Rehm is a library for manipulating URIs that has a method chaining API. It makes manipulating everything from authentication details to query strings extremely easy:

  .query('field', 'value')
    // http://dailyjs.com/files/example.html?field=value#header

For a complete list of methods, see the URI.js API documentation.