web-mocha

0.0.10 • Public • Published

web-mocha

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.

Getting Started

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

Usage

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


  Usage: web-mocha [options] <path>

  Options:

    -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

Example:

# 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
 

License

web-mocha is licensed under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i web-mocha

Weekly Downloads

13

Version

0.0.10

License

BSD

Last publish

Collaborators

  • gabrielmancini