Package detail

@northbrook/mocha

northbrookjs13MIT3.1.1

Mocha Configuration for Northbrook

mocha, northbrook, plugin, testing

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

changelog

3.1.1 (2017-01-30)


Bug Fixes

  • fix(handler): fix for error messages 2b4d8be4

3.1.0 (2017-01-09)


Features

  • feat(mocha): add configurability of pattern matching a08f4f42

3.0.1 (2017-01-03)


Bug Fixes

  • fix(handler): add back exclude filtering 815a3836

3.0.0 (2017-01-03)


Breaking Changes

  1. removes changed config option
    • feat(mocha): update to latest northbrook and remove changed config 5f88e886

2.2.0 (2017-01-03)


Features

  • feat(mocha): add option to exclude packages 27ecf9a0

2.1.5 (2017-01-02)


Bug Fixes

  • fix(runTests): do not run .js files in generated folders e81c2606

2.1.4 (2017-01-02)


Bug Fixes

  • fix(runTests): add generated file folders to blacklist 54b13b30

2.1.3 (2017-01-02)


Bug Fixes

  • fix(mocha): exit with 1 on errors 4bd4d2e8

2.1.2 (2017-01-02)


Bug Fixes

  • fix(runTests): fix default test regex patterns 886abaa3

2.1.1 (2016-12-23)


Bug Fixes

  • fix(mocha): default configuration causes many errors to throw 005c7a28

2.1.0 (2016-12-23)


Features

  • feat(mocha): support es2015 tests out of box with buba 7f168231

2.0.0 (2016-12-23)


Features

  • feat(mocha): Reimplement for v4 of Northbrook 0c861d9b

v1.0.0 (2016-09-04)


Breaking Changes

  • feat(mocha): initial implemenation of mocha configuration 2b0476ce