@@ -97,7 +97,7 @@ describe('useCompareReplacements', () => {
9797 type : 'simple' ,
9898 description : 'You can use the modulo operator to check if a number is even.' ,
9999 example : '(n % 2) === 0' ,
100- } satisfies ModuleReplacement ,
100+ } satisfies SimpleModuleReplacement ,
101101 } )
102102 }
103103 return Promise . resolve ( null )
@@ -250,15 +250,17 @@ describe('useCompareReplacements', () => {
250250 describe ( 'caching' , ( ) => {
251251 it ( 'retries a package after a transient fetch failure' , async ( ) => {
252252 const packageNames = ref ( [ 'is-even' ] )
253- const fetchMock = vi
254- . fn ( )
255- . mockRejectedValueOnce ( new Error ( 'Temporary network error' ) )
256- . mockResolvedValueOnce ( {
257- id : 'snippet::is-even' ,
258- type : 'simple' ,
259- description : 'You can use the modulo operator to check if a number is even.' ,
260- example : '(n % 2) === 0' ,
261- } satisfies SimpleModuleReplacement )
253+ const fetchMock = vi . fn ( )
254+ . mockRejectedValueOnce ( new Error ( 'Temporary network error' ) )
255+ . mockResolvedValueOnce ( {
256+ mapping : { replacements : [ 'snippet::is-even' ] } ,
257+ replacement : {
258+ id : 'snippet::is-even' ,
259+ type : 'simple' ,
260+ description : 'You can use the modulo operator to check if a number is even.' ,
261+ example : '(n % 2) === 0' ,
262+ } satisfies SimpleModuleReplacement ,
263+ } )
262264
263265 vi . stubGlobal ( '$fetch' , fetchMock )
264266
@@ -314,7 +316,7 @@ describe('useCompareReplacements', () => {
314316 type : 'simple' ,
315317 description : 'Check even' ,
316318 example : '(n % 2) === 0' ,
317- } satisfies ModuleReplacement ,
319+ } satisfies SimpleModuleReplacement ,
318320 } )
319321 }
320322 return Promise . resolve ( null )
0 commit comments