Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1d62a0

Browse files
committed
don't add test specific exports in runtime
1 parent061e18b commita1d62a0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎src/run/storage/request-scoped-in-memory-cache.cts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ function getInMemoryLRUCache() {
150150
returnextendedGlobalThis[IN_MEMORY_LRU_CACHE]
151151
}
152152

153-
exportfunctionclearInMemoryLRUCacheForTesting(){
154-
extendedGlobalThis[IN_MEMORY_LRU_CACHE]=undefined
155-
}
156-
157153
interfaceRequestScopedInMemoryCache{
158154
get(key:string):
159155
|{conditional:false;currentRequestValue:BlobType|null|Promise<BlobType|null>}

‎src/run/storage/storage.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { decodeBlobKey } from '../../../tests/utils/helpers.ts'
66
import{BlobType}from'../../shared/blob-types.cts'
77
import{createRequestContext,runWithRequestContext}from'../handlers/request-context.cts'
88

9-
import{clearInMemoryLRUCacheForTesting}from'./request-scoped-in-memory-cache.cts'
109
import{getMemoizedKeyValueStoreBackedByRegionalBlobStore}from'./storage.cts'
1110

1211
functionmockGenerateRecord(data:BlobType){
@@ -77,7 +76,11 @@ function generate30MBBlobTypeValue(id: string): BlobType {
7776
}
7877

7978
beforeEach(()=>{
80-
clearInMemoryLRUCacheForTesting()
79+
// reset in memory cache between tests
80+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
81+
constunTypedGlobalThis=globalThisasany
82+
unTypedGlobalThis[Symbol.for('nf-in-memory-lru-cache')]=undefined
83+
8184
mockBlobValues={
8285
[TEST_KEY]:mockGenerateRecord(TEST_DEFAULT_VALUE),
8386
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp