feat: v0.6.0 — data foundation: Drizzle ORM + SQLite (sql.js/WASM) persistence, first-run seed, read-only GET /api/state snapshot

This commit is contained in:
2026-09-17 11:51:42 +00:00
parent 4d9a1e9fa9
commit 7fdc43bc7e
23 changed files with 1006 additions and 8 deletions
+20
View File
@@ -0,0 +1,20 @@
import { describe, expect, it } from 'vitest';
import { haversineKm } from './geo';
describe('haversineKm', () => {
it('returns 0 for identical points', () => {
expect(haversineKm(50.03, 8.57, 50.03, 8.57)).toBeCloseTo(0, 10);
});
it('computes the London → Paris great-circle distance (~343 km)', () => {
const km = haversineKm(51.47, -0.454, 49.0097, 2.5479); // LHR → CDG
expect(km).toBeGreaterThan(330);
expect(km).toBeLessThan(360);
});
it('is symmetric', () => {
const a = haversineKm(50.03, 8.57, 40.47, -3.56); // FRA → MAD
const b = haversineKm(40.47, -3.56, 50.03, 8.57);
expect(a).toBeCloseTo(b, 10);
});
});