@@ -41,13 +41,13 @@ describe('page router', () => {
4141 // check if the blob entries where successful set on the build plugin
4242 const blobEntries = await getBlobEntries ( ctx )
4343 expect ( blobEntries . map ( ( { key } ) => decodeBlobKey ( key . substring ( 0 , 50 ) ) ) . sort ( ) ) . toEqual ( [
44+ // the real key is much longer and ends in a hash, but we only assert on the first 50 chars to make it easier
45+ '/products/an-incredibly-long-product-' ,
46+ '/static/revalidate-automatic' ,
47+ '/static/revalidate-manual' ,
48+ '/static/revalidate-slow' ,
4449 '404.html' ,
4550 '500.html' ,
46- // the real key is much longer and ends in a hash, but we only assert on the first 50 chars to make it easier
47- 'products/an-incredibly-long-product-n' ,
48- 'static/revalidate-automatic' ,
49- 'static/revalidate-manual' ,
50- 'static/revalidate-slow' ,
5151 ] )
5252
5353 // test the function call
@@ -116,14 +116,14 @@ describe('app router', () => {
116116 // check if the blob entries where successful set on the build plugin
117117 const blobEntries = await getBlobEntries ( ctx )
118118 expect ( blobEntries . map ( ( { key } ) => decodeBlobKey ( key ) ) . sort ( ) ) . toEqual ( [
119- '404' ,
119+ '/404' ,
120+ '/index' ,
121+ '/posts/1' ,
122+ '/posts/2' ,
120123 '404.html' ,
121124 '460ed46cd9a194efa197be9f2571e51b729a039d1cff9834297f416dce5ada29' ,
122125 '500.html' ,
123126 'ad74683e49684ff4fe3d01ba1bef627bc0e38b61fa6bd8244145fbaca87f3c49' ,
124- 'index' ,
125- 'posts/1' ,
126- 'posts/2' ,
127127 ] )
128128
129129 // test the function call
@@ -138,7 +138,7 @@ describe('app router', () => {
138138 } ) ,
139139 )
140140
141- expect ( await ctx . blobStore . get ( decodeBlobKey ( ' posts/3') ) ) . toBeNull ( )
141+ expect ( await ctx . blobStore . get ( encodeBlobKey ( '/ posts/3') ) ) . toBeNull ( )
142142 // this page is not pre-rendered and should result in a cache miss
143143 const post3 = await invokeFunction ( ctx , { url : 'posts/3' } )
144144 expect ( post3 . statusCode ) . toBe ( 200 )
@@ -152,7 +152,7 @@ describe('app router', () => {
152152 // wait to have a stale page
153153 await new Promise < void > ( ( resolve ) => setTimeout ( resolve , 5_000 ) )
154154 // after the dynamic call of `posts/3` it should be in cache, not this is after the timout as the cache set happens async
155- expect ( await ctx . blobStore . get ( encodeBlobKey ( 'posts/3' ) ) ) . not . toBeNull ( )
155+ expect ( await ctx . blobStore . get ( encodeBlobKey ( '/ posts/3' ) ) ) . not . toBeNull ( )
156156
157157 const stale = await invokeFunction ( ctx , { url : 'posts/1' } )
158158 const staleDate = load ( stale . body ) ( '[data-testid="date-now"]' ) . text ( )
@@ -188,20 +188,20 @@ describe('plugin', () => {
188188 // check if the blob entries where successful set on the build plugin
189189 const blobEntries = await getBlobEntries ( ctx )
190190 expect ( blobEntries . map ( ( { key } ) => decodeBlobKey ( key ) ) . sort ( ) ) . toEqual ( [
191- '404' ,
191+ '/404' ,
192+ '/api/revalidate-handler' ,
193+ '/index' ,
194+ '/revalidate-fetch' ,
195+ '/static-fetch-1' ,
196+ '/static-fetch-2' ,
197+ '/static-fetch-3' ,
198+ '/static-fetch/1' ,
199+ '/static-fetch/2' ,
192200 '404.html' ,
193201 '460ed46cd9a194efa197be9f2571e51b729a039d1cff9834297f416dce5ada29' ,
194202 '500.html' ,
195203 'ac26c54e17c3018c17bfe5ae6adc0e6d37dbfaf28445c1f767ff267144264ac9' ,
196204 'ad74683e49684ff4fe3d01ba1bef627bc0e38b61fa6bd8244145fbaca87f3c49' ,
197- 'api/revalidate-handler' ,
198- 'index' ,
199- 'revalidate-fetch' ,
200- 'static-fetch-1' ,
201- 'static-fetch-2' ,
202- 'static-fetch-3' ,
203- 'static-fetch/1' ,
204- 'static-fetch/2' ,
205205 ] )
206206 } )
207207} )
@@ -212,7 +212,7 @@ describe('route', () => {
212212 await runPlugin ( ctx )
213213
214214 // check if the route got prerendered
215- const blobEntry = await ctx . blobStore . get ( encodeBlobKey ( 'api/revalidate-handler' ) , {
215+ const blobEntry = await ctx . blobStore . get ( encodeBlobKey ( '/ api/revalidate-handler' ) , {
216216 type : 'json' ,
217217 } )
218218 expect ( blobEntry ) . not . toBeNull ( )
0 commit comments