Set $NODE_ENV to "development" works best with mocha --require=env-development
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
LICENSE
README.md
package.json

README.md

env-development Build Status

Set $NODE_ENV to "development".

Works best with mocha --require env-development.

Why?

Because to force environment, I was used to add process.env.NODE_ENV = "development" at the beginning of every file.

Because relying on Makefile or 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

Install with npm:

npm install env-development

Usage

With mocha

  • Install with npm install --save-dev env-development
  • Edit test/mocha.opts and add the line --requir env-development

Related

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu