# mocha-setup

> 🚨 A mocha require file including some basic things I usually use

Latest version **0.0.2** (published 2019-10-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install mocha-setup
pnpm add mocha-setup
yarn add mocha-setup
bun add mocha-setup
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-10-31 |
| First published | 2019-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | omrilotan |
| Maintainers | omrilotan |
| Keywords | mocha, setup, require, 🚨 |

## Links

- npm: https://www.npmjs.com/package/mocha-setup
- Repository: https://github.com/omrilotan/package
- Homepage: https://github.com/omrilotan/package#readme
- Issues: https://github.com/omrilotan/package/issues
- npm.io page: https://npm.io/package/mocha-setup

## Dependencies (8)

- [chai](https://npm.io/package/chai.md) ^4.2.0
- [mocha](https://npm.io/package/mocha.md) ^6.2.2
- [sinon](https://npm.io/package/sinon.md) ^7.5.0
- [abuser](https://npm.io/package/abuser.md) ^2.0.2
- [sinon-chai](https://npm.io/package/sinon-chai.md) ^3.3.0
- [chai-string](https://npm.io/package/chai-string.md) ^1.5.0
- [chai-as-promised](https://npm.io/package/chai-as-promised.md) ^7.1.1
- [deep-equal-in-any-order](https://npm.io/package/deep-equal-in-any-order.md) ^1.0.21

## Recent versions

- 0.0.2 (latest) — 2019-10-31
- 0.0.1 — 2019-10-02
- 0.0.0 — 2019-09-09

## README

# mocha-setup [![CircleCI](https://circleci.com/gh/omrilotan/mocha-setup.svg?style=svg)](https://circleci.com/gh/omrilotan/mocha-setup)
🚨 A mocha require file including some basic things I usually use

This setup includes the globals:
- chai functions: assert, expect
- sinon
- sinon function: spy, fake, stub
- abuser

It also extends chai with:
- chai-as-promised
- chai-string
- deep-equal-in-any-order
- sinon-chai

package.json
```json
  ...
  "test": "mocha '**/spec.js' --require .mocha.js --recursive --exclude 'node_modules'",
  ...
```

.mocha.js
```js
require('mocha-setup');

// Your other things
process.on('unhandledRejection', error => { throw error; });
```

.eslintrc.js
```js
const globals = require('mocha-setup/globals');

module.exports = {
	...
	overrides: [
		{
			files: [ "**/spec.js" ],
			globals
		}
	]
};
```

Or add to your own globals
```js
			...
			globals: Object.assign(globals, {...})
		}
```

---
_Source: https://npm.io/package/mocha-setup · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
