Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

518 B
Raw Blame
import test from 'node:test';
import assert from 'node:assert/strict';
import { parseCoordinateQuery } from './coordinateParser.js';
test('search refuses omitted components and repeated separators', () => {
  for (const q of ['30,, -97', ',30,-97', '30,-97,', '30;; -97', '30,; -97'])
    assert.equal(parseCoordinateQuery(q), null, q);
  for (const q of ['30,-97', '30; -97', '30 -97', 'N 30, W 97'])
    assert.deepEqual(
      [parseCoordinateQuery(q).lat, parseCoordinateQuery(q).lon],
      [30, -97],
    );
});