mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-03-21 17:54:13 -05:00
Remove stale jsonpath tests from util.test.mjs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ecce394315
commit
6fba6f3076
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user