@@ -93,7 +93,7 @@ describe('S3Cache', () => {
93
93
ContentType : 'application/json'
94
94
} )
95
95
96
- const result = await s3Cache . get ( cacheKey , cacheKey )
96
+ const result = await s3Cache . get ( cacheKey , cacheKey , mockCacheContext )
97
97
expect ( result ) . toEqual ( mockCacheEntry . value . pageData )
98
98
expect ( s3Cache . client . getObject ) . toHaveBeenCalledTimes ( 1 )
99
99
expect ( s3Cache . client . getObject ) . toHaveBeenCalledWith ( {
@@ -118,7 +118,7 @@ describe('S3Cache', () => {
118
118
ContentType : 'text/x-component'
119
119
} )
120
120
121
- const result = await s3Cache . get ( cacheKey , cacheKey )
121
+ const result = await s3Cache . get ( cacheKey , cacheKey , mockCacheContext )
122
122
expect ( result ) . toEqual ( mockCacheEntry . value . pageData )
123
123
expect ( s3Cache . client . getObject ) . toHaveBeenCalledTimes ( 1 )
124
124
expect ( s3Cache . client . getObject ) . toHaveBeenCalledWith ( {
@@ -143,7 +143,7 @@ describe('S3Cache', () => {
143
143
ContentType : 'application/json'
144
144
} )
145
145
146
- const result = await s3Cache . get ( cacheKey , cacheKey )
146
+ const result = await s3Cache . get ( cacheKey , cacheKey , mockCacheContext )
147
147
expect ( result ) . toEqual ( mockCacheEntry . value . pageData )
148
148
expect ( s3Cache . client . getObject ) . toHaveBeenCalledTimes ( 1 )
149
149
expect ( s3Cache . client . getObject ) . toHaveBeenCalledWith ( {
@@ -152,7 +152,7 @@ describe('S3Cache', () => {
152
152
} )
153
153
154
154
await s3Cache . delete ( cacheKey , cacheKey )
155
- const updatedResult = await s3Cache . get ( cacheKey , cacheKey )
155
+ const updatedResult = await s3Cache . get ( cacheKey , cacheKey , mockCacheContext )
156
156
expect ( updatedResult ) . toBeNull ( )
157
157
expect ( s3Cache . client . deleteObjects ) . toHaveBeenCalledTimes ( 1 )
158
158
expect ( s3Cache . client . deleteObjects ) . toHaveBeenNthCalledWith ( 1 , {
@@ -171,19 +171,19 @@ describe('S3Cache', () => {
171
171
const mockCacheEntryWithTags = { ...mockCacheEntry , tags : [ cacheKey ] }
172
172
await s3Cache . set ( cacheKey , cacheKey , mockCacheEntryWithTags , mockCacheContext )
173
173
174
- expect ( await s3Cache . get ( cacheKey , cacheKey ) ) . toEqual ( mockCacheEntryWithTags . value . pageData )
174
+ expect ( await s3Cache . get ( cacheKey , cacheKey , mockCacheContext ) ) . toEqual ( mockCacheEntryWithTags . value . pageData )
175
175
176
176
await s3Cache . revalidateTag ( cacheKey , [ ] )
177
177
178
- expect ( await s3Cache . get ( cacheKey , cacheKey ) ) . toBeNull ( )
178
+ expect ( await s3Cache . get ( cacheKey , cacheKey , mockCacheContext ) ) . toBeNull ( )
179
179
} )
180
180
181
181
it ( 'should revalidate cache by path' , async ( ) => {
182
182
await s3Cache . set ( cacheKey , cacheKey , mockCacheEntry , mockCacheContext )
183
183
184
- expect ( await s3Cache . get ( cacheKey , cacheKey ) ) . toEqual ( mockCacheEntry . value . pageData )
184
+ expect ( await s3Cache . get ( cacheKey , cacheKey , mockCacheContext ) ) . toEqual ( mockCacheEntry . value . pageData )
185
185
186
186
await s3Cache . deleteAllByKeyMatch ( cacheKey , [ ] )
187
- expect ( await s3Cache . get ( cacheKey , cacheKey ) ) . toBeNull ( )
187
+ expect ( await s3Cache . get ( cacheKey , cacheKey , mockCacheContext ) ) . toBeNull ( )
188
188
} )
189
189
} )
0 commit comments