import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import { parseGpx } from '../src/services/gpx.js';

test('parseGpx liest Beispielstrecke', () => {
  const parsed = parseGpx(fs.readFileSync(new URL('../examples/sample-route.gpx', import.meta.url), 'utf8'));
  assert.equal(parsed.name, 'Beispielweg'); assert.equal(parsed.points.length, 3); assert.ok(parsed.metrics.distanceM > 0);
});
