File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/plugins/next-mocks/alias/cache Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,29 @@ const unstable_noStore: Mock<Procedure> = fn().mockName(
2323) ;
2424const refresh : Mock < Procedure > = fn ( ) . mockName ( "next/cache::refresh" ) ;
2525
26+ // mock utilities/overrides (as of Next v15.0.0)
27+ const cacheLife : Mock < Procedure > = fn ( ) . mockName ( "next/cache::cacheLife" ) ;
28+ const cacheTag : Mock < Procedure > = fn ( ) . mockName ( "next/cache::cacheTag" ) ;
29+
30+ // deprecated wrappers (as of Next v16.0.0)
31+ const unstable_cacheLife : Mock < Procedure > = fn ( )
32+ . mockName ( "next/cache::unstable_cacheLife" )
33+ . mockImplementation ( ( ...args ) => cacheLife ( ...args ) ) ;
34+ const unstable_cacheTag : Mock < Procedure > = fn ( )
35+ . mockName ( "next/cache::unstable_cacheTag" )
36+ . mockImplementation ( ( ...args ) => cacheTag ( ...args ) ) ;
37+
2638const cacheExports = {
2739 unstable_cache,
2840 revalidateTag,
2941 revalidatePath,
3042 updateTag,
3143 refresh,
3244 unstable_noStore,
45+ cacheLife,
46+ cacheTag,
47+ unstable_cacheLife,
48+ unstable_cacheTag,
3349} ;
3450
3551export default cacheExports ;
@@ -40,4 +56,8 @@ export {
4056 unstable_noStore ,
4157 refresh ,
4258 updateTag ,
59+ cacheLife ,
60+ cacheTag ,
61+ unstable_cacheLife ,
62+ unstable_cacheTag ,
4363} ;
You can’t perform that action at this time.
0 commit comments