fix(bridge): ranking.test flaky freshness assertion (BIT-26754)
Tests / writer-pipeline tests (push) Successful in 41s
Tests / bridge tests (push) Successful in 40s
Tests / frontend lib tests (push) Successful in 43s
Tests / bridge tests (pull_request) Successful in 43s
Tests / writer-pipeline tests (pull_request) Successful in 45s
Tests / frontend lib tests (pull_request) Successful in 42s

This commit is contained in:
José Alves committed 2026-07-17 09:06:28 +00:00
1 parent 70e862f18e
commit 6b89206f82
1 file changed
+3 -2
+3 -2
View File
@@ -13,8 +13,9 @@ import type { WriterConfig } from './writer-config.js';
// ── calculate_freshness_score ──────────────────────────────────────────────
test('freshness score is 1 for a brand-new article', () => {
const now = new Date().toISOString();
assert.equal(calculate_freshness_score(now), 1.0);
// Use a future timestamp: ageHours < 0 → guaranteed return 1.0, no floating-point drift.
const nearFuture = new Date(Date.now() + 1000).toISOString();
assert.equal(calculate_freshness_score(nearFuture), 1.0);
});
test('freshness score is 0 for article at or beyond maxAgeHours', () => {