@trailstash/ultra
Version:
A web based tool for making MapLibre GL maps with data from sources such as Overpass, GeoJSON, GPX, KML, TCX, etc
33 lines (30 loc) • 877 B
JavaScript
/**
* @jest-environment jsdom
*/
import overpass from "./overpass.js";
describe("overpass", () => {
it("should detect Overpass XML", () => {
expect(overpass.detect("<osm-script></osm-script>")).toEqual(true);
});
it("should detect OverpassQL", () => {
expect(overpass.detect("node(8072127669);out;")).toEqual(true);
expect(
overpass.detect("node[amenity=bicycle_repair_station];out meta;"),
).toEqual(true);
expect(
overpass.detect(
"[bbox:-85.05112899999985,-143.4237868840288,85.05112900000006,143.19307950688642];way[highway];out geom;",
),
).toEqual(true);
expect(
overpass.detect(`[bbox:-85.05112899999985,-143.4237868840288,85.05112900000006,143.19307950688642];
(
way[highway=path];
way[highway=footway];
way[highway=cycleway];
way[highway=steps];
);
out meta geom;`),
).toEqual(true);
});
});