change .outputErrors to false for "test" env only

good to know in prod ;)
This commit is contained in:
TJ Holowaychuk 2013-08-21 19:48:47 -07:00
parent 2de010ca47
commit 9d7720f2d8
2 changed files with 2 additions and 2 deletions

View file

@ -42,7 +42,7 @@ http.createServer(app.callback()).listen(3001);
- `app.proxy` when true proxy header fields will be trusted - `app.proxy` when true proxy header fields will be trusted
- `app.subdomainOffset` offset of `.subdomains` to ignore [2] - `app.subdomainOffset` offset of `.subdomains` to ignore [2]
- `app.jsonSpaces` default JSON response spaces [2] - `app.jsonSpaces` default JSON response spaces [2]
- `app.outputErrors` output err.stack to stderr [true in "development"] - `app.outputErrors` output err.stack to stderr [false in "test" environment]
### app.listen(...) ### app.listen(...)

View file

@ -33,7 +33,7 @@ exports = module.exports = Application;
function Application() { function Application() {
if (!(this instanceof Application)) return new Application; if (!(this instanceof Application)) return new Application;
this.env = process.env.NODE_ENV || 'development'; this.env = process.env.NODE_ENV || 'development';
this.outputErrors = 'development' == this.env; this.outputErrors = 'test' != this.env;
this.subdomainOffset = 2; this.subdomainOffset = 2;
this.poweredBy = true; this.poweredBy = true;
this.jsonSpaces = 2; this.jsonSpaces = 2;