A thin wrapper around mocha that finds tests anywhere in your project and provides a utility that gets tests up and running quickly

  • npm install --save-dev mycha
  • add ./node_modules/.bin to your PATH environment variable
  • mycha install

    • prompts you for where you would like to install your default test helper, testHelperPath

    • runs

      npm install --save-dev chai
      npm install --save-dev sinon
      npm install --save-dev sinon-chai
    • writes to testHelperPath

      chai = require 'chai'
      sinon = require 'sinon'
      chai.use require 'sinon-chai'
      global.expect = chai.expect
      global.sinon = sinon
      process.env.NODE_ENV = 'test'
    • writes to

      module.exports =
        # Environment variables to add to process.env when running mocha 
        mochaEnv: {}
        # Default options to pass to mocha (can be overriden by command line options) 
          colors: yes
          compilers: 'coffee:coffee-script/register'
          reporter: 'dot'
        # Path patten used for finding tests (see 
        testFilePattern: '**/*_{spec,test}.{coffee,js}'
        # Files to include before all tests 
        testHelpers: [
  • mycha [mochaOptions] [<folder>...] [<file>...]

    • if no folders or files are specified runs all tests
    • if folders or files are specified, pass them through to mocha

see our developer documentation