File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,6 +134,17 @@ describe("express with slowap", function () {
134134 . expect ( 504 , done ) ;
135135 } ) . timeout ( 10000 ) ;
136136
137+ it ( "GET /slow, completes multiple polling cycles " , ( done ) => {
138+ request ( server )
139+ . get ( `/slow?final_status=200&complete_in=3` )
140+ . set ( "x-sync-wait" , "5" )
141+ . expect ( 200 )
142+ . then ( ( { headers } ) => {
143+ const pollCount = parseInt ( headers [ "set-cookie" ] [ 0 ] . split ( "=" ) [ 1 ] ) ;
144+ assert . isAbove ( pollCount , 1 ) ;
145+ done ( ) ;
146+ } )
147+ } ) . timeout ( 10000 )
137148} ) ;
138149
139150
@@ -211,6 +222,18 @@ describe("express with slowap with sub path", function () {
211222 . expect ( 504 , done ) ;
212223 } ) . timeout ( 10000 ) ;
213224
225+ it ( "GET /slow, completes multiple polling cycles " , ( done ) => {
226+ request ( server )
227+ . get ( `/slow?final_status=200&complete_in=3` )
228+ . set ( "x-sync-wait" , "5" )
229+ . expect ( 200 )
230+ . then ( ( { headers } ) => {
231+ const pollCount = parseInt ( headers [ "set-cookie" ] [ 0 ] . split ( "=" ) [ 1 ] ) ;
232+ assert . isAbove ( pollCount , 1 )
233+ done ( ) ;
234+ } )
235+ } ) . timeout ( 10000 )
236+
214237 // it("slowapp patch request", (done) => {
215238 // request(server)
216239 // .patch("/slow?final_status=500&complete_in=5")
You can’t perform that action at this time.
0 commit comments