I'm using AVA to run my tests. I use a config.js file at the root and I'd like it to be different when running test units. For example the path to the databases, in production ~/.app/data.db
would be /tmp/<randomid>/data.db
while testing. With mocha I'd just check for it
existence but here I can't
I am using the NODE_ENV variable to load different configs for production, staging and development. Works like a charm.
Read this article to get you started with a nice setup: http://eng.datafox.co/nodejs/2014/09/28/nodejs-config-best-practices/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With