@@ -73,64 +73,6 @@ describe("Middleware package test", function () {
7373 cacheClient . quit ( ) ;
7474 cacheClient = null ;
7575 } ) ;
76- it ( 'It will test if the middleware stores the object in cache' , function ( done ) {
77- request ( app )
78- . get ( '/test/getvalue' )
79- . expect ( 200 )
80- . end ( function ( err , res ) {
81- if ( err ) return done ( err ) ;
82- cacheClient . getObject ( [ 'TEST-MIDDLEWARE' , '/test/getvalue' ] , ( error , data ) => {
83- expect ( data ) . not . toBeNull ( ) ;
84- done ( ) ;
85- } ) ;
86- } ) ;
87- } ) ;
88- it ( 'It will test if the middleware deletes the cache' , function ( done ) {
89- request ( app )
90- . post ( '/test/update' )
91- . expect ( 200 )
92- . end ( function ( err , res ) {
93- if ( err ) return done ( err ) ;
94- delay ( 200 )
95- . then ( ( ) => {
96- cacheClient . getObject ( [ 'TEST-MIDDLEWARE' , '/test/getvalue' ] , ( error , data ) => {
97- expect ( data ) . toBeNull ( ) ;
98- done ( ) ;
99- } ) ;
100- } ) ;
101- } ) ;
102- } ) ;
103- it ( 'It will test if the middleware allows to cache a post method' , function ( done ) {
104- request ( app )
105- . post ( '/test/postData' )
106- . send ( {
107- test : "value"
108- } )
109- . expect ( 'Content-Type' , / j s o n / )
110- . expect ( 200 )
111- . end ( function ( err , res ) {
112- if ( err ) return done ( err ) ;
113- cacheClient . getObject ( [ 'TEST-MIDDLEWARE' , '/test/postData:test:value' ] , ( error , data ) => {
114- expect ( data ) . not . toBeNull ( ) ;
115- done ( ) ;
116-
117- } ) ;
118- } ) ;
119- } ) ;
120- it ( 'It will test if the middleware ignores a method' , function ( done ) {
121- request ( app )
122- . get ( '/test/ignore' )
123- . expect ( 200 )
124- . end ( function ( err , res ) {
125- if ( err ) return done ( err ) ;
126- cacheClient . getObject ( [ 'TEST-MIDDLEWARE' , '/test/ignore' ] , ( error , data ) => {
127- expect ( data ) . toBeNull ( ) ;
128- done ( ) ;
129-
130- } ) ;
131- } ) ;
132- } ) ;
133-
13476 it ( 'It will test if the middleware cache data directly' , function ( done ) {
13577 request ( app )
13678 . post ( '/test/addDataDirectly' )
@@ -149,19 +91,6 @@ describe("Middleware package test", function () {
14991 expect ( res . body ) . toEqual ( mockData ) ;
15092 done ( ) ;
15193 } ) ;
152- } ) ;
153- it ( 'It will test the recreateResponse method' , function ( done ) {
154- request ( app )
155- . get ( '/test/recreateResponse' )
156- . expect ( 200 )
157- . end ( function ( err , res ) {
158- if ( err ) return done ( err ) ;
159- cacheClient . getObject ( [ 'TEST-MIDDLEWARE' , '/test/recreateResponse' , 'TEST' ] , ( error , data ) => {
160- expect ( data ) . not . toBeNull ( ) ;
161- done ( ) ;
162-
163- } ) ;
164- } ) ;
16594 } ) ;
16695 it ( 'It will test if the middleware clears data by prefix directly' , function ( done ) {
16796 request ( app )
0 commit comments