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:
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user