import { describe } from './_harness.mjs';
import { evaluateFreshness } from '../../../src/core/freshness.mjs';
describe('freshness', (it)=>{
const now = new Date('2025-10-13');
it('stale if beyond threshold', ()=>{
const r = evaluateFreshness('2025-06-01', { now, thresholdDays: 60 });
if(!r.stale) throw new Error('expected stale');
});
it('fresh if within threshold', ()=>{
const r = evaluateFreshness('2025-10-01', { now, thresholdDays: 60 });
if(r.stale) throw new Error('expected fresh');
});
it('warning on invalid date', ()=>{
const r = evaluateFreshness('invalid-date', { now });
if(r.warning!=='invalid_date') throw new Error('missing invalid_date warning');
});
});