From b3ba7820a3ee1ed75eca8daeac93257d2e21aa7f Mon Sep 17 00:00:00 2001 From: Avior Date: Mon, 11 Nov 2024 22:35:49 +0100 Subject: [PATCH] chore: remove unused tests Signed-off-by: Avior --- __tests__/cache.test.js | 54 ----------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 __tests__/cache.test.js diff --git a/__tests__/cache.test.js b/__tests__/cache.test.js deleted file mode 100644 index 77d69e8..0000000 --- a/__tests__/cache.test.js +++ /dev/null @@ -1,54 +0,0 @@ -/// - -const { default: MemoryCache } = require("../src/Psr/SimpleCache/MemoryCache") - -const TCGdex = require("../src/tcgdex").default - -test('that cache store and get one element', async () => { - const cache = new MemoryCache() - cache.set('a', 'b') - expect(cache.get('a')).toBe('b') -}) - -test('that cache store and get multiple elements', async () => { - const cache = new MemoryCache() - cache.setMultiple({ - 'a': 'b', - 'c': 'd' - }) - expect(cache.getMultiple(['a', 'c'])).toStrictEqual({ - a: 'b', - c: 'd' - }) -}) - -test('cache expiration', async () => { - const cache = new MemoryCache() - cache.set('a', 'b', 1) - // wait 2 secs - await new Promise((res) => setTimeout(res, 2000)) - expect(cache.get('a')).toBeUndefined() -}) - -test('cache deletion', async () => { - const cache = new MemoryCache() - cache.set('a', 'b') - expect(cache.get('a')).toBe('b') - cache.delete('a') - expect(cache.get('a')).toBeUndefined() -}) - -test('cache cleared', async () => { - const cache = new MemoryCache() - cache.set('a', 'b') - expect(cache.get('a')).toBe('b') - cache.clear() - expect(cache.get('a')).toBeUndefined() -}) - -test('cache exists', async () => { - const cache = new MemoryCache() - expect(cache.has('a')).toBe(false) - cache.set('a', 'b') - expect(cache.has('a')).toBe(true) -})