node package manager


A mocha http server


web-mocha runs a simple HTTP server, serving up your Mocha tests. This allows you to run the same suite of tests on the command line (with Node.js) and in the browser.

web-mocha requires Node.js and npm. Once you have these dependencies, you can install mocha-srv with the following command:

$ npm install -g web-mocha

Once installed, the web-mocha command should be available to you.

  Usage: web-mocha [options] <path>
    -h, --help           output usage information
    -V, --version        output the version number
    -p, --port <port>    specify the port to run the server on. Default: 3000
    -t, --title <title>  specify the test suite title
    -u, --ui <ui>        specify the Mocha UI your tests use, one of: bdd (default), tdd


# Run web-mocha, serving unit tests in ./tests 
$ web-mocha ./tests
# Run web-mocha on port 1337 and run tests in TDD style 
$ web-mocha -p 1337 -u tdd ./tests
# Run using a env variables 
NODE_ENV=test NODE_PATH=lib web-mocha test

web-mocha is licensed under the MIT license.