mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 12:19:51 +01:00
No 'json spaces' by default
Json rendering can be handled by user tools or overridden in their own app to behave as desired. Minimizes the use of magic env settings.
This commit is contained in:
parent
8c3f153dd4
commit
8c059469fd
|
|
@ -82,10 +82,6 @@ app.defaultConfiguration = function(){
|
|||
this.set('views', process.cwd() + '/views');
|
||||
this.set('jsonp callback name', 'callback');
|
||||
|
||||
this.configure('development', function(){
|
||||
this.set('json spaces', 2);
|
||||
});
|
||||
|
||||
if (this.get('env') === 'production') {
|
||||
this.enable('view cache');
|
||||
};
|
||||
|
|
|
|||
|
|
@ -95,14 +95,7 @@ describe('res', function(){
|
|||
})
|
||||
|
||||
describe('"json spaces" setting', function(){
|
||||
it('should default to 2 in development', function(){
|
||||
process.env.NODE_ENV = 'development';
|
||||
var app = express();
|
||||
app.get('json spaces').should.equal(2);
|
||||
process.env.NODE_ENV = 'test';
|
||||
})
|
||||
|
||||
it('should be undefined otherwise', function(){
|
||||
it('should be undefined by default', function(){
|
||||
var app = express();
|
||||
assert(undefined === app.get('json spaces'));
|
||||
})
|
||||
|
|
|
|||
|
|
@ -181,14 +181,7 @@ describe('res', function(){
|
|||
})
|
||||
|
||||
describe('"json spaces" setting', function(){
|
||||
it('should default to 2 in development', function(){
|
||||
process.env.NODE_ENV = 'development';
|
||||
var app = express();
|
||||
app.get('json spaces').should.equal(2);
|
||||
process.env.NODE_ENV = 'test';
|
||||
})
|
||||
|
||||
it('should be undefined otherwise', function(){
|
||||
it('should be undefined by default', function(){
|
||||
var app = express();
|
||||
assert(undefined === app.get('json spaces'));
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user