refactor: show mileage data freshness
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { formatMileageSnapshotTime } from './data-freshness.js';
|
||||
|
||||
test('formats snapshot instants in Asia/Shanghai', () => {
|
||||
assert.equal(formatMileageSnapshotTime('2026-08-07T07:45:06.000Z'), '15:45:06');
|
||||
});
|
||||
|
||||
test('keeps historical date snapshots explicit', () => {
|
||||
assert.equal(formatMileageSnapshotTime('2026-08-06'), '2026-08-06');
|
||||
assert.equal(formatMileageSnapshotTime(null), '--:--:--');
|
||||
});
|
||||
Reference in New Issue
Block a user