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
... "test": "mocha '**/spec.js' --require .mocha.js --recursive --exclude 'node_modules'", ...
.mocha.js
; // Your other thingsprocess;
.eslintrc.js
const globals = ; moduleexports = ... overrides: files: "**/spec.js" globals ;
Or add to your own globals
... globals: Object }