Set $NODE_ENV to "development".
Works best with
mocha --require env-development.
Because to force environment, I was used to add
process.env.NODE_ENV = "development" at the beginning of every file.
Because relying on
package.json to set this environment is almost always OK, but when one user just throws
mocha in his terminal we don't want to punish him with data loss or any other hell.
Whereas relying on
mocha.opts makes it easy (no more ugly line in each test file) and reliable (always loaded).
Install with npm:
npm install env-development
- Install with
npm install --save-dev env-development
test/mocha.optsand add the line
See Releases page.
Install devDependencies and Run
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT © azu