From 6d7fe95c5828405af28dab5ed9e7e91169f68e6b Mon Sep 17 00:00:00 2001 From: Michael Auerswald Date: Wed, 27 Sep 2023 12:03:15 +0200 Subject: [PATCH] fix(core): Do not set ttl globally in test (no-changelog) (#7271) --- .../cli/test/unit/services/cache.service.test.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/cli/test/unit/services/cache.service.test.ts b/packages/cli/test/unit/services/cache.service.test.ts index 53689bec1b..4624e7cc0d 100644 --- a/packages/cli/test/unit/services/cache.service.test.ts +++ b/packages/cli/test/unit/services/cache.service.test.ts @@ -80,10 +80,7 @@ describe('cacheService', () => { }); test('should honour ttl values', async () => { - // set default TTL to 10ms - config.set('cache.memory.ttl', 10); - - await cacheService.set('testString', 'test'); + await cacheService.set('testString', 'test', 10); await cacheService.set('testNumber1', 123, 1000); const store = (await cacheService.getCache())?.store; @@ -92,15 +89,6 @@ describe('cacheService', () => { await expect(store!.ttl('testString')).resolves.toBeLessThanOrEqual(100); await expect(store!.ttl('testNumber1')).resolves.toBeLessThanOrEqual(1000); - - // commented out because it fails on CI sporadically - // await expect(cacheService.get('testString')).resolves.toBe('test'); - // await expect(cacheService.get('testNumber1')).resolves.toBe(123); - - // await new Promise((resolve) => setTimeout(resolve, 20)); - - // await expect(cacheService.get('testString')).resolves.toBeUndefined(); - // await expect(cacheService.get('testNumber1')).resolves.toBe(123); }); test('should set and remove values', async () => {