@northbrook/mocha

Mocha Configuration for Northbrook

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
10Jan 30, 2017Sep 4, 2016Minified + gzip package size for @northbrook/mocha in KB

Readme

@northbrook/mocha

Test your packages with Mocha

Seamless testing with Mocha for Northbrook. Handles TypeScript and ES2015 tests out-of-box.

Requires test files to be named using one of the following patterns:

  • .test.(js|ts)
  • .spec.(js|ts),
  • -test.(js|ts),
  • -spec.(js|ts)
  • Test.(js|ts),
  • Spec.(js|ts)

Let me have it!

npm install --save-dev @northbrook/mocha

Usage

Configuration

// northbrook.js
const mocha = require('@northbrook/mocha').plugin;
// northbrook.ts
import { plugin as mocha } from '@nothrbook/mocha';

module.exports = {
  plugins: [ mocha ],

  // 100% optional
  mocha: {
    // An array of packages to require before running your tests
    // That would normally be used as `mocha -r _____`
    require: [ 'jsdom-global/register' ],
    // An array of packages you would like to be excluded from test running
    exclude: [ 'name-of-package' ]
  }
}

CLI

northbrook mocha

CLI Options

--changed

Only run tests for the packages that have changed since last release. This option is very useful for speeding up CI testing for monorepos.

northbrook mocha --changed
--require

A list of packages, separated by comma, to require before running your tests That would normally be used as mocha -r _____

northbrook mocha --require jsdom-global/register,buba/register

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.