diff --git a/app/common/util.test.mjs b/app/common/util.test.mjs index 72074ca..de1a65b 100644 --- a/app/common/util.test.mjs +++ b/app/common/util.test.mjs @@ -8,8 +8,6 @@ import { getFestId, getFestTeamId, getXRankSeasonId, - jsonpathQuery, - jsonpathApply, calculateCacheExpiry, } from './util.mjs'; @@ -163,29 +161,6 @@ describe('getXRankSeasonId', () => { }); }); -describe('jsonpathQuery', () => { - it('returns matching values from nested objects', () => { - const data = { store: { books: [{ title: 'A' }, { title: 'B' }] } }; - const result = jsonpathQuery(data, '$.store.books[*].title'); - expect(result).toEqual(['A', 'B']); - }); - - it('returns empty array for no match', () => { - const data = { a: 1 }; - const result = jsonpathQuery(data, '$.b'); - expect(result).toEqual([]); - }); -}); - -describe('jsonpathApply', () => { - it('transforms matching values in-place', () => { - const data = { items: [{ price: 10 }, { price: 20 }] }; - jsonpathApply(data, '$.items[*].price', v => v * 2); - expect(data.items[0].price).toBe(20); - expect(data.items[1].price).toBe(40); - }); -}); - describe('calculateCacheExpiry', () => { it('returns timestamp = now + expiresIn - 5 minutes', () => { const before = Date.now();