Getting Started

First install foounit with npm:

$ npm install foounit


Then follow these steps to run tests...

In nodejs

Generate a sample suite in the spec directory:

$ foounit generate --type=node spec

Run the test:

$ node spec/example_spec.js

In the browser

Generate a sample suite in the spec directory:

$ foounit generate --type=browser spec

Start a web server in the directory where the suite was created:

$ foounit-server --spec=spec

Open a web browser at http://localhost:5057/spec/suite.html

Shared client and server code

Generate a sample suite in the spec directory:

$ foounit generate --type=browser,node spec
foounit is smart enough to know that when multiple environments are specified that it should create a shared directory for multi-environment testing

Run the tests for each environment by following the directions in the previous steps.



About

foounit is an asynchronous BDD-style javascript test framework aimed at making cross-environment javascript testing simple. foounit is designed to make testing code that is shared between the server and the client less of a chore. It supports both commonjs loading and global scope loading of script files for immediate test dependencies in all environments. Test files are loaded in a functionally scoped environment to help minimize test pollution when running your suite. Test syntax is influenced heavily by Screw Unit, Jasmine and rspec.

foounit is the love child of Bob Remeika (me). It was written out of spite while consuming large amounts of alcohol. If you notice some bad code within foounit, it's definitely due to alcohol abuse. I'm not even going to try to pretend that I *meant* to do that. If you want to help with code quality then patches are accepted.

A common question that I get is why didn't I just use Jasmine. See the FAQ.

foounit is currently used at Yammer Inc. as the primary test harness for a core component of our client/server side architecture called yamjs.

foounit is a Dojo Foundation project and is licensed under the Dojo Foundation License. This basically means that no One Company owns the project and the code is gauranteed to be IP Free (free as in beer). This is another reason why I didn't want to use Jasmine.

This website was created by Heather Phillips (Yammer) and the logo was created by James Kang (Yammer).



Documentation