Some checks failed
Test and deploy staging / staging (push) Has been cancelled
11 lines
434 B
TypeScript
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);
|
|
});
|
|
});
|