@@ -83,28 +83,49 @@ describe('app.path()', function(){
83
83
} )
84
84
85
85
describe ( 'in development' , function ( ) {
86
+ before ( function ( ) {
87
+ this . env = process . env . NODE_ENV
88
+ process . env . NODE_ENV = 'development'
89
+ } )
90
+
91
+ after ( function ( ) {
92
+ process . env . NODE_ENV = this . env
93
+ } )
94
+
86
95
it ( 'should disable "view cache"' , function ( ) {
87
- process . env . NODE_ENV = 'development' ;
88
96
var app = express ( ) ;
89
97
assert . ok ( ! app . enabled ( 'view cache' ) )
90
- process . env . NODE_ENV = 'test' ;
91
98
} )
92
99
} )
93
100
94
101
describe ( 'in production' , function ( ) {
102
+ before ( function ( ) {
103
+ this . env = process . env . NODE_ENV
104
+ process . env . NODE_ENV = 'production'
105
+ } )
106
+
107
+ after ( function ( ) {
108
+ process . env . NODE_ENV = this . env
109
+ } )
110
+
95
111
it ( 'should enable "view cache"' , function ( ) {
96
- process . env . NODE_ENV = 'production' ;
97
112
var app = express ( ) ;
98
113
assert . ok ( app . enabled ( 'view cache' ) )
99
- process . env . NODE_ENV = 'test' ;
100
114
} )
101
115
} )
102
116
103
117
describe ( 'without NODE_ENV' , function ( ) {
118
+ before ( function ( ) {
119
+ this . env = process . env . NODE_ENV
120
+ process . env . NODE_ENV = ''
121
+ } )
122
+
123
+ after ( function ( ) {
124
+ process . env . NODE_ENV = this . env
125
+ } )
126
+
104
127
it ( 'should default to development' , function ( ) {
105
- process . env . NODE_ENV = '' ;
106
128
var app = express ( ) ;
107
129
assert . strictEqual ( app . get ( 'env' ) , 'development' )
108
- process . env . NODE_ENV = 'test' ;
109
130
} )
110
131
} )
0 commit comments