@@ -2071,7 +2071,10 @@ describe('Prerender', () => {
20712071
20722072 it ( 'should handle revalidating JSON correctly' , async ( ) => {
20732073 const route = `/_next/data/${ next . buildId } /blog/post-2/comment-3.json`
2074- const initialJson = await renderViaHTTP ( next . url , route )
2074+ const initialRes = await fetchViaHTTP ( next . url , route )
2075+ const initialJson = await initialRes . text ( )
2076+ expect ( initialRes . headers . get ( 'Content-Length' ) ) . toBeDefined ( )
2077+ expect ( initialRes . headers . get ( 'ETag' ) ) . toBeDefined ( )
20752078 expect ( initialJson ) . toMatch ( / p o s t - 2 / )
20762079 expect ( initialJson ) . toMatch ( / c o m m e n t - 3 / )
20772080
@@ -2086,7 +2089,10 @@ describe('Prerender', () => {
20862089 await renderViaHTTP ( next . url , route )
20872090
20882091 await check ( async ( ) => {
2089- newJson = await renderViaHTTP ( next . url , route )
2092+ const newRes = await fetchViaHTTP ( next . url , route )
2093+ expect ( newRes . headers . get ( 'Content-Length' ) ) . toBeDefined ( )
2094+ expect ( newRes . headers . get ( 'ETag' ) ) . toBeDefined ( )
2095+ newJson = await newRes . text ( )
20902096 return newJson !== initialJson ? 'success' : newJson
20912097 } , 'success' )
20922098
@@ -2143,7 +2149,10 @@ describe('Prerender', () => {
21432149
21442150 it ( 'should handle revalidating HTML correctly with blocking and seed' , async ( ) => {
21452151 const route = '/blocking-fallback/a'
2146- const initialHtml = await renderViaHTTP ( next . url , route )
2152+ const initialRes = await fetchViaHTTP ( next . url , route )
2153+ const initialHtml = await initialRes . text ( )
2154+ expect ( initialRes . headers . get ( 'Content-Length' ) ) . toBeDefined ( )
2155+ expect ( initialRes . headers . get ( 'ETag' ) ) . toBeDefined ( )
21472156 const $initial = cheerio . load ( initialHtml )
21482157 expect ( $initial ( 'p' ) . text ( ) ) . toBe ( 'Post: a' )
21492158
@@ -2158,7 +2167,10 @@ describe('Prerender', () => {
21582167 await renderViaHTTP ( next . url , route )
21592168
21602169 await check ( async ( ) => {
2161- newHtml = await renderViaHTTP ( next . url , route )
2170+ const newRes = await fetchViaHTTP ( next . url , route )
2171+ expect ( newRes . headers . get ( 'Content-Length' ) ) . toBeDefined ( )
2172+ expect ( newRes . headers . get ( 'ETag' ) ) . toBeDefined ( )
2173+ newHtml = await newRes . text ( )
21622174 return newHtml !== initialHtml ? 'success' : newHtml
21632175 } , 'success' )
21642176
0 commit comments