fpereira1 / mocha-domains

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mocha domains

Enable support for domains in Mocha tests.

Installation

npm install mocha-domains --save-dev

Usage

Just require the module in your tests and start writing domains in your tests.

Node

Install the module using npm install mocha-domains --save-dev. Now just require the module to automatically monkey patch any available mocha instances. With mocha, you have multiple ways of requiring the module - add --require mocha-domains to your mocha.opts or add require('mocha-domains') inside your main test file.

If you need to monkey patch a different mocha instance you can use the library directly:

var mocha = require('mocha')
var mochaDomains = require('mocha-domains')

mochaDomains(mocha)

How It Works

The module monkey patches the Runnable.prototype.run method of mocha to enable domains. In contrast to other npm packages, mocha-domains extends mocha at runtime - allowing you to use any compatible mocha version.

About


Languages

Language:JavaScript 100.0%