@@ -51,32 +51,33 @@ describe("express with google upstream and botli decompress", function () {
5151 . set ( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" )
5252 . set ( "Accept-Encoding" , "gzip, deflate, br" )
5353 . set ( "User-Agent" , "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36" )
54- // .expect(r => {
55- // expect(r.text).to.be.a("string").and.satisfy(body => body.startsWith("<!doctype html>"));
56- // assert.equal(r.headers["content-encoding"], "gzip");
57- // })
58- // .expect(200, done);
59- .
60- expect ( ( res ) => {
61- // Status
62- // eslint-disable-next-line no-console
63- console . log ( "DEBUG status:" , res . status ) ;
64-
65- // Headers
66- // eslint-disable-next-line no-console
67- console . log ( "DEBUG headers:" , res . headers ) ;
68-
69- // Body (string for HTML; res.body is used for JSON)
70- const snippet = ( res . text || "" ) . slice ( 0 , 500 ) ;
71- // eslint-disable-next-line no-console
72- console . log ( "DEBUG body first 500 chars:\n" , snippet ) ;
54+ . expect ( r => {
55+ expect ( r . text ) . to . be . a ( "string" ) . and . satisfy ( body => body . startsWith ( "<!doctype html>" ) ) ;
56+ assert . equal ( r . headers [ "content-encoding" ] , "gzip" ) ;
7357 } )
7458 . expect ( 200 , done ) ;
59+
60+ // .expect((res) => {
61+ // // Status
62+ // // eslint-disable-next-line no-console
63+ // console.log("DEBUG status:", res.status);
64+
65+ // // Headers
66+ // // eslint-disable-next-line no-console
67+ // console.log("DEBUG headers:", res.headers);
68+
69+ // // Body (string for HTML; res.body is used for JSON)
70+ // const snippet = (res.text || "").slice(0, 500);
71+ // // eslint-disable-next-line no-console
72+ // console.log("DEBUG body first 500 chars:\n", snippet);
73+ // })
74+ // .expect(200, done);
7575 } ) ;
7676
7777 it ( "returns good content for / with chrome headers" , ( done ) => {
7878 request ( server )
7979 . get ( "/" )
80+ . redirects ( 1 )
8081 . set ( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" )
8182 . set ( "Accept-Encoding" , "gzip, deflate, br" )
8283 . set ( "Cache-Control" , "no-cache" )
@@ -127,6 +128,7 @@ describe("express with google upstream without botli decompress", function () {
127128 it ( "returns content-encoding br / with accept-encoding and User-Agent" , ( done ) => {
128129 request ( server )
129130 . get ( "/" )
131+ . redirects ( 1 )
130132 . set ( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" )
131133 . set ( "Accept-Encoding" , "gzip, deflate, br" )
132134 . set ( "User-Agent" , "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36" )
0 commit comments