@@ -271,7 +271,7 @@ describe("DOShardedTagCache", () => {
271271
272272 it ( "should only read tag data once on a regional-cache miss" , async ( ) => {
273273 const putMock = vi . fn ( ) ;
274- // @ts -expect-error - Defined on cloudfare context
274+ // @ts -expect-error - Defined on cloudflare context
275275 globalThis . caches = {
276276 open : vi . fn ( ) . mockResolvedValue ( {
277277 match : vi . fn ( ) . mockResolvedValue ( null ) ,
@@ -294,7 +294,7 @@ describe("DOShardedTagCache", () => {
294294 "http://local.cache/shard/tag-hard;shard-1?tag=tag1" ,
295295 expect . any ( Response )
296296 ) ;
297- // @ts -expect-error - Defined on cloudfare context
297+ // @ts -expect-error - Defined on cloudflare context
298298 globalThis . caches = undefined ;
299299 } ) ;
300300
@@ -437,15 +437,15 @@ describe("DOShardedTagCache", () => {
437437 } ) ;
438438
439439 it ( "should try to return the cache instance if regional cache is enabled" , async ( ) => {
440- // @ts -expect-error - Defined on cloudfare context
440+ // @ts -expect-error - Defined on cloudflare context
441441 globalThis . caches = {
442442 open : vi . fn ( ) . mockResolvedValue ( "cache" ) ,
443443 } ;
444444 const cache = shardedDOTagCache ( { baseShardSize : 4 , regionalCache : true } ) ;
445445 expect ( cache . localCache ) . toBeUndefined ( ) ;
446446 expect ( await cache . getCacheInstance ( ) ) . toBe ( "cache" ) ;
447447 expect ( cache . localCache ) . toBe ( "cache" ) ;
448- // @ts -expect-error - Defined on cloudfare context
448+ // @ts -expect-error - Defined on cloudflare context
449449 globalThis . caches = undefined ;
450450 } ) ;
451451 } ) ;
@@ -462,7 +462,7 @@ describe("DOShardedTagCache", () => {
462462 } ) ;
463463
464464 it ( "should call .match on the cache" , async ( ) => {
465- // @ts -expect-error - Defined on cloudfare context
465+ // @ts -expect-error - Defined on cloudflare context
466466 globalThis . caches = {
467467 open : vi . fn ( ) . mockResolvedValue ( {
468468 match : vi . fn ( ) . mockResolvedValue ( new Response ( "1234567" ) ) ,
@@ -478,13 +478,13 @@ describe("DOShardedTagCache", () => {
478478 expect ( cacheResult . length ) . toBe ( 1 ) ;
479479 // "1234567" is a plain number (old format) → backward-compat parse
480480 expect ( cacheResult [ 0 ] ) . toEqual ( { tag : "tag1" , revalidatedAt : 1234567 , stale : 1234567 , expire : null } ) ;
481- // @ts -expect-error - Defined on cloudfare context
481+ // @ts -expect-error - Defined on cloudflare context
482482 globalThis . caches = undefined ;
483483 } ) ;
484484
485485 it ( "should parse new JSON object format from the cache" , async ( ) => {
486486 const stored = JSON . stringify ( { revalidatedAt : 1000 , stale : 500 , expire : 9999 } ) ;
487- // @ts -expect-error - Defined on cloudfare context
487+ // @ts -expect-error - Defined on cloudflare context
488488 globalThis . caches = {
489489 open : vi . fn ( ) . mockResolvedValue ( {
490490 match : vi . fn ( ) . mockResolvedValue ( new Response ( stored ) ) ,
@@ -494,7 +494,7 @@ describe("DOShardedTagCache", () => {
494494 const doId = new DOId ( { baseShardId : "shard-1" , numberOfReplicas : 1 , shardType : "hard" } ) ;
495495 const cacheResult = await cache . getFromRegionalCache ( { doId, tags : [ "tag1" ] } ) ;
496496 expect ( cacheResult [ 0 ] ) . toEqual ( { tag : "tag1" , revalidatedAt : 1000 , stale : 500 , expire : 9999 } ) ;
497- // @ts -expect-error - Defined on cloudfare context
497+ // @ts -expect-error - Defined on cloudflare context
498498 globalThis . caches = undefined ;
499499 } ) ;
500500 } ) ;
@@ -513,7 +513,7 @@ describe("DOShardedTagCache", () => {
513513
514514 it ( "should put the tags in the regional cache if the tags exists in the DO" , async ( ) => {
515515 const putMock = vi . fn ( ) ;
516- // @ts -expect-error - Defined on cloudfare context
516+ // @ts -expect-error - Defined on cloudflare context
517517 globalThis . caches = {
518518 open : vi . fn ( ) . mockResolvedValue ( {
519519 put : putMock ,
@@ -535,13 +535,13 @@ describe("DOShardedTagCache", () => {
535535 "http://local.cache/shard/tag-hard;shard-1?tag=tag1" ,
536536 expect . any ( Response )
537537 ) ;
538- // @ts -expect-error - Defined on cloudfare context
538+ // @ts -expect-error - Defined on cloudflare context
539539 globalThis . caches = undefined ;
540540 } ) ;
541541
542542 it ( "should not put the tags in the regional cache if the tags does not exists in the DO" , async ( ) => {
543543 const putMock = vi . fn ( ) ;
544- // @ts -expect-error - Defined on cloudfare context
544+ // @ts -expect-error - Defined on cloudflare context
545545 globalThis . caches = {
546546 open : vi . fn ( ) . mockResolvedValue ( {
547547 put : putMock ,
@@ -560,13 +560,13 @@ describe("DOShardedTagCache", () => {
560560
561561 expect ( getTagDataMock ) . toHaveBeenCalledWith ( [ "tag1" ] ) ;
562562 expect ( putMock ) . not . toHaveBeenCalled ( ) ;
563- // @ts -expect-error - Defined on cloudfare context
563+ // @ts -expect-error - Defined on cloudflare context
564564 globalThis . caches = undefined ;
565565 } ) ;
566566
567567 it ( "should put multiple tags in the regional cache" , async ( ) => {
568568 const putMock = vi . fn ( ) ;
569- // @ts -expect-error - Defined on cloudfare context
569+ // @ts -expect-error - Defined on cloudflare context
570570 globalThis . caches = {
571571 open : vi . fn ( ) . mockResolvedValue ( {
572572 put : putMock ,
@@ -595,13 +595,13 @@ describe("DOShardedTagCache", () => {
595595 "http://local.cache/shard/tag-hard;shard-1?tag=tag2" ,
596596 expect . any ( Response )
597597 ) ;
598- // @ts -expect-error - Defined on cloudfare context
598+ // @ts -expect-error - Defined on cloudflare context
599599 globalThis . caches = undefined ;
600600 } ) ;
601601
602602 it ( "should put missing tag in the regional cache if `regionalCacheDangerouslyPersistMissingTags` is true" , async ( ) => {
603603 const putMock = vi . fn ( ) ;
604- // @ts -expect-error - Defined on cloudfare context
604+ // @ts -expect-error - Defined on cloudflare context
605605 globalThis . caches = {
606606 open : vi . fn ( ) . mockResolvedValue ( {
607607 put : putMock ,
@@ -627,13 +627,13 @@ describe("DOShardedTagCache", () => {
627627 "http://local.cache/shard/tag-hard;shard-1?tag=tag1" ,
628628 expect . any ( Response )
629629 ) ;
630- // @ts -expect-error - Defined on cloudfare context
630+ // @ts -expect-error - Defined on cloudflare context
631631 globalThis . caches = undefined ;
632632 } ) ;
633633
634634 it ( "should not put missing tag in the regional cache if `regionalCacheDangerouslyPersistMissingTags` is false" , async ( ) => {
635635 const putMock = vi . fn ( ) ;
636- // @ts -expect-error - Defined on cloudfare context
636+ // @ts -expect-error - Defined on cloudflare context
637637 globalThis . caches = {
638638 open : vi . fn ( ) . mockResolvedValue ( {
639639 put : putMock ,
@@ -656,7 +656,7 @@ describe("DOShardedTagCache", () => {
656656
657657 expect ( getTagDataMock ) . toHaveBeenCalledWith ( [ "tag1" ] ) ;
658658 expect ( putMock ) . not . toHaveBeenCalled ( ) ;
659- // @ts -expect-error - Defined on cloudfare context
659+ // @ts -expect-error - Defined on cloudflare context
660660 globalThis . caches = undefined ;
661661 } ) ;
662662 } ) ;
0 commit comments