diff --git a/packages/tron-wallet-snap/src/caching/useCache.test.ts b/packages/tron-wallet-snap/src/caching/useCache.test.ts index d69a17da..a0efd1f5 100644 --- a/packages/tron-wallet-snap/src/caching/useCache.test.ts +++ b/packages/tron-wallet-snap/src/caching/useCache.test.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-vars,@typescript-eslint/no-shadow */ +/* eslint-disable @typescript-eslint/no-unused-vars */ import type { Serializable } from '../utils/serialization/types'; import type { ICache } from './ICache'; import { useCache } from './useCache'; @@ -318,14 +318,16 @@ describe('useCache', () => { describe('function name override', () => { it('should use the provided function name if given', async () => { - const cachedWithCustomName = useCache(testFunction, cache, { - ttlMilliseconds: 1000, - functionName: 'customFunctionName', - }); + await withUseCache(async ({ testFunction, cache }) => { + const cachedWithCustomName = useCache(testFunction, cache, { + ttlMilliseconds: 1000, + functionName: 'customFunctionName', + }); - await cachedWithCustomName(); + await cachedWithCustomName(); - expect(cache.get).toHaveBeenCalledWith('customFunctionName:'); + expect(cache.get).toHaveBeenCalledWith('customFunctionName:'); + }); }); });