Files
website/src/lib/geo.test.ts
Stan Runge d0c7b6548b
Some checks failed
Test and deploy staging / staging (push) Has been cancelled
beeeeg update
2026-09-23 04:16:50 +00:00

11 lines
434 B
TypeScript

import { describe, expect, it } from 'vitest';
import { distanceMeters } from './geo';
describe('distanceMeters', () => {
it('keeps nearby sightings within the 30 km limit and rejects distant ones', () => {
expect(distanceMeters(52.009, 4.708, 52.009, 4.708)).toBe(0);
expect(distanceMeters(52.009, 4.708, 52.01, 4.71)).toBeLessThan(30_000);
expect(distanceMeters(52.009, 4.708, 52.37, 4.9)).toBeGreaterThan(30_000);
});
});