@@ -41,13 +41,13 @@ describe('page router', () => {
41
41
// check if the blob entries where successful set on the build plugin
42
42
const blobEntries = await getBlobEntries ( ctx )
43
43
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' ,
44
49
'404.html' ,
45
50
'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' ,
51
51
] )
52
52
53
53
// test the function call
@@ -116,14 +116,14 @@ describe('app router', () => {
116
116
// check if the blob entries where successful set on the build plugin
117
117
const blobEntries = await getBlobEntries ( ctx )
118
118
expect ( blobEntries . map ( ( { key } ) => decodeBlobKey ( key ) ) . sort ( ) ) . toEqual ( [
119
- '404' ,
119
+ '/404' ,
120
+ '/index' ,
121
+ '/posts/1' ,
122
+ '/posts/2' ,
120
123
'404.html' ,
121
124
'460ed46cd9a194efa197be9f2571e51b729a039d1cff9834297f416dce5ada29' ,
122
125
'500.html' ,
123
126
'ad74683e49684ff4fe3d01ba1bef627bc0e38b61fa6bd8244145fbaca87f3c49' ,
124
- 'index' ,
125
- 'posts/1' ,
126
- 'posts/2' ,
127
127
] )
128
128
129
129
// test the function call
@@ -138,7 +138,7 @@ describe('app router', () => {
138
138
} ) ,
139
139
)
140
140
141
- expect ( await ctx . blobStore . get ( decodeBlobKey ( ' posts/3') ) ) . toBeNull ( )
141
+ expect ( await ctx . blobStore . get ( encodeBlobKey ( '/ posts/3') ) ) . toBeNull ( )
142
142
// this page is not pre-rendered and should result in a cache miss
143
143
const post3 = await invokeFunction ( ctx , { url : 'posts/3' } )
144
144
expect ( post3 . statusCode ) . toBe ( 200 )
@@ -152,7 +152,7 @@ describe('app router', () => {
152
152
// wait to have a stale page
153
153
await new Promise < void > ( ( resolve ) => setTimeout ( resolve , 5_000 ) )
154
154
// 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 ( )
156
156
157
157
const stale = await invokeFunction ( ctx , { url : 'posts/1' } )
158
158
const staleDate = load ( stale . body ) ( '[data-testid="date-now"]' ) . text ( )
@@ -188,20 +188,20 @@ describe('plugin', () => {
188
188
// check if the blob entries where successful set on the build plugin
189
189
const blobEntries = await getBlobEntries ( ctx )
190
190
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' ,
192
200
'404.html' ,
193
201
'460ed46cd9a194efa197be9f2571e51b729a039d1cff9834297f416dce5ada29' ,
194
202
'500.html' ,
195
203
'ac26c54e17c3018c17bfe5ae6adc0e6d37dbfaf28445c1f767ff267144264ac9' ,
196
204
'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' ,
205
205
] )
206
206
} )
207
207
} )
@@ -212,7 +212,7 @@ describe('route', () => {
212
212
await runPlugin ( ctx )
213
213
214
214
// 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' ) , {
216
216
type : 'json' ,
217
217
} )
218
218
expect ( blobEntry ) . not . toBeNull ( )
0 commit comments