File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,30 @@ describe('res', function(){
180180 } ) ;
181181 } ) ;
182182
183+ describe ( 'with "maxAge" option' , function ( ) {
184+ it ( 'should set cache-control max-age from number' , function ( done ) {
185+ var app = createApp ( path . resolve ( __dirname , 'fixtures/name.txt' ) , {
186+ maxAge : 14400000
187+ } )
188+
189+ request ( app )
190+ . get ( '/' )
191+ . expect ( 'Cache-Control' , 'public, max-age=14400' )
192+ . expect ( 200 , done )
193+ } )
194+
195+ it ( 'should set cache-control max-age from string' , function ( done ) {
196+ var app = createApp ( path . resolve ( __dirname , 'fixtures/name.txt' ) , {
197+ maxAge : '4h'
198+ } )
199+
200+ request ( app )
201+ . get ( '/' )
202+ . expect ( 'Cache-Control' , 'public, max-age=14400' )
203+ . expect ( 200 , done )
204+ } )
205+ } )
206+
183207 describe ( 'with "root" option' , function ( ) {
184208 it ( 'should not transfer relative with without' , function ( done ) {
185209 var app = createApp ( 'test/fixtures/name.txt' ) ;
You can’t perform that action at this time.
0 commit comments