feat: publish mileage assessment freshness
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { formatMileageSnapshotTime } from './data-freshness.js';
|
||||
import { formatMileageSnapshotDateTime, formatMileageSnapshotTime } from './data-freshness.js';
|
||||
|
||||
test('formats snapshot instants in Asia/Shanghai', () => {
|
||||
assert.equal(formatMileageSnapshotTime('2026-08-07T07:45:06.000Z'), '15:45:06');
|
||||
@@ -10,3 +10,9 @@ test('keeps historical date snapshots explicit', () => {
|
||||
assert.equal(formatMileageSnapshotTime('2026-08-06'), '2026-08-06');
|
||||
assert.equal(formatMileageSnapshotTime(null), '--:--:--');
|
||||
});
|
||||
|
||||
test('formats assessment snapshot instants with the business date and minute', () => {
|
||||
assert.equal(formatMileageSnapshotDateTime('2026-08-07T09:45:01.000Z'), '2026.8.7 17:45');
|
||||
assert.equal(formatMileageSnapshotDateTime(null), '--');
|
||||
assert.equal(formatMileageSnapshotDateTime('not-a-date'), 'not-a-date');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user