Pass `this` context as the first argument of the arrow function.
npm install mocha-contextmocha-context
=============



Pass this context as the first argument of the arrow function.
Installation
------------
``
`
npm install -D mocha-context
`
Usage
-----
You can import patched functions from this module:
js
`
const {it} = require("mocha-context");
describe("my test", () => {
it("skip me", t => {
t.skip();
});
});
mocha-context/register
Or replace global functions by requiring :
`
js
`
require("mocha-context/register");
describe("my test", () => {
it("skip me", t => {
t.skip();
});
});
--require
You can tell mocha to the library from CLI, so you don't have to require() it manually:
`
console
`
$ mocha -r mocha-context/register
`
js
`
describe("my test", () => {
it("skip me", t => {
t.skip();
});
});
mocha.opts
You can also add it to which would be picked by CLI:
`
test/mocha.opts
`
-r mocha-context/register
`
console
`
$ mocha
`
js
`
describe("my test", () => {
it("skip me", t => {
t.skip();
});
});
lib
Similar projects
----------------
* arrow-mocha: Without global register, ES module.
Changelog
---------
* 0.1.5 (May 24, 2018)
- Fix: is not included in the dist.
global
* 0.1.4 (May 24, 2018)
- Fix: reference error when doesn't exist.
xxx.only
* 0.1.3 (May 24, 2018)
- Fix: support , xxx.skip.
before
- Fix: hooks (, beforeEach`, etc) have different signature.
* 0.1.2 (May 23, 2018)
- Fix: register hook doesn't work with multiple test files.
* 0.1.1 (May 23, 2018)
- Fix: register hook.
* 0.1.0 (May 22, 2018)
- First release.