@northbrook/mocha
TypeScript icon, indicating that this package has built-in type declarations

3.1.1 • Public • Published

@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

Package Sidebar

Install

npm i @northbrook/mocha

Weekly Downloads

6

Version

3.1.1

License

MIT

Last publish

Collaborators

  • northbrook