by Jason on December 9, 2011
Recently I’ve been working with RailwayJS and integrating Mocha for testing. However, I wasn’t able to figure out how to explicitly set the environment. As such, it was always defaulting to “development” which is not ideal.
For those wondering, you want to do this:
process.env.NODE_ENV = ‘test’; //change to whatever environment you need
You will place this before:
var app = module.exports = require(‘railway’).createServer();