Remove stale jsonpath tests from util.test.mjs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Isenhower 2026-02-15 16:55:28 -08:00
parent ecce394315
commit 6fba6f3076

View File

@ -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();