UNPKG

overpass-frontend

Version:

A JavaScript (NodeJS/Browser) library to easily access data from OpenStreetMap via Overpass API or from an OSM File. The objects can directly be used with LeafletJS or exported to GeoJSON. Data will be cached in the browser memory.

19 lines (15 loc) 512 B
const assert = require('assert').strict module.exports = function ({ ob, boundingboxes, expected }) { Object.keys(boundingboxes).forEach(k => { if (!(k in expected)) { assert.fail('no expected result for test "' + k + '"') } const result = ob.intersects(boundingboxes[k]) assert.equal(result, expected[k], 'intersects test "' + k + '"') }) Object.keys(expected).forEach(k => { if (!(k in boundingboxes)) { assert.fail('no bounding box for test "' + k + '"') } }) }