@@ -869,11 +869,11 @@ describe('node-static', function () {
869869 } ) ;
870870 } ) ;
871871
872- describe ( 'once an http server is listening with false custom cache configuration' , function ( ) {
872+ describe ( 'once an http server is listening with null custom cache configuration' , function ( ) {
873873 beforeEach ( async function ( ) {
874874 await setupStaticServer ( this ) ;
875875 fileServer = new statik . Server ( __dirname + '/../fixtures' , {
876- cache : false
876+ cache : null
877877 } ) ;
878878 } ) ;
879879 afterEach ( async function ( ) {
@@ -897,4 +897,33 @@ describe('node-static', function () {
897897 assert . equal ( response . headers . get ( 'cache-control' ) , null , 'should not respond with cache-control' ) ;
898898 } ) ;
899899 } ) ;
900+
901+ describe ( 'once an http server is listening with false custom cache configuration' , function ( ) {
902+ beforeEach ( async function ( ) {
903+ await setupStaticServer ( this ) ;
904+ fileServer = new statik . Server ( __dirname + '/../fixtures' , {
905+ cache : false
906+ } ) ;
907+ } ) ;
908+ afterEach ( async function ( ) {
909+ this . server . close ( ) ;
910+ } ) ;
911+
912+ it ( 'requesting custom cache index file' , async function ( ) {
913+ const response = await fetch ( this . getTestServer ( ) + '/' ) ;
914+ assert . equal ( response . status , 200 , 'should respond with 200' ) ;
915+ assert . equal ( response . headers . get ( 'cache-control' ) , 'no-cache' , 'should respond with cache-control' ) ;
916+ } ) ;
917+ it ( 'requesting custom cache text file' , async function ( ) {
918+ const response = await fetch ( this . getTestServer ( ) + '/hello.txt' ) ;
919+
920+ assert . equal ( response . status , 200 , 'should respond with 200' ) ;
921+ assert . equal ( response . headers . get ( 'cache-control' ) , 'no-cache' , 'should respond with cache-control' ) ;
922+ } ) ;
923+ it ( 'requesting custom cache un-cached file' , async function ( ) {
924+ const response = await fetch ( this . getTestServer ( ) + '/empty.css' ) ;
925+ assert . equal ( response . status , 200 , 'should respond with 200' ) ;
926+ assert . equal ( response . headers . get ( 'cache-control' ) , 'no-cache' , 'should respond with cache-control' ) ;
927+ } ) ;
928+ } ) ;
900929} ) ;
0 commit comments