File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -150,10 +150,6 @@ function getInMemoryLRUCache() {
150150 return extendedGlobalThis [ IN_MEMORY_LRU_CACHE ]
151151}
152152
153- export function clearInMemoryLRUCacheForTesting ( ) {
154- extendedGlobalThis [ IN_MEMORY_LRU_CACHE ] = undefined
155- }
156-
157153interface RequestScopedInMemoryCache {
158154 get ( key : string ) :
159155 | { conditional : false ; currentRequestValue : BlobType | null | Promise < BlobType | null > }
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { decodeBlobKey } from '../../../tests/utils/helpers.ts'
66import { BlobType } from '../../shared/blob-types.cts'
77import { createRequestContext , runWithRequestContext } from '../handlers/request-context.cts'
88
9- import { clearInMemoryLRUCacheForTesting } from './request-scoped-in-memory-cache.cts'
109import { getMemoizedKeyValueStoreBackedByRegionalBlobStore } from './storage.cts'
1110
1211function mockGenerateRecord ( data : BlobType ) {
@@ -77,7 +76,11 @@ function generate30MBBlobTypeValue(id: string): BlobType {
7776}
7877
7978beforeEach ( ( ) => {
80- clearInMemoryLRUCacheForTesting ( )
79+ // reset in memory cache between tests
80+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
81+ const unTypedGlobalThis = globalThis as any
82+ unTypedGlobalThis [ Symbol . for ( 'nf-in-memory-lru-cache' ) ] = undefined
83+
8184 mockBlobValues = {
8285 [ TEST_KEY ] : mockGenerateRecord ( TEST_DEFAULT_VALUE ) ,
8386 }
You can’t perform that action at this time.
0 commit comments