diff --git a/packages/http-front-cache/src/lib/cache-factory.spec.ts b/packages/http-front-cache/src/lib/cache-factory.spec.ts index aabff10..be4ae47 100644 --- a/packages/http-front-cache/src/lib/cache-factory.spec.ts +++ b/packages/http-front-cache/src/lib/cache-factory.spec.ts @@ -123,6 +123,13 @@ describe('cacheFactory', () => { } ); + it('Should not call the service function again if cache is available', async () => { + await cachedServiceFunction(defaultParams); + expect(mockServiceFunction).toHaveBeenCalledTimes(1); + await cachedServiceFunction(defaultParams); + expect(mockServiceFunction).toHaveBeenCalledTimes(1); + }); + it('should not set data in the cache if the service function throws an error', async () => { mockServiceFunction.mockImplementationOnce(async () => { throw new Error('Error'); diff --git a/release.config.base.js b/release.config.base.js index cf1b43e..4bf2db2 100644 --- a/release.config.base.js +++ b/release.config.base.js @@ -1,3 +1,4 @@ module.exports = { extends: 'semantic-release-npm-github-publish', + plugins: ['@semantic-release/npm'], };