smeijer / leaflet-geosearch

A geocoding/address-lookup library supporting various api providers.
https://smeijer.github.io/leaflet-geosearch/
MIT License
1.02k stars 270 forks source link

test: custom jest assertion for coordinate/bounds validation #303

Closed missinglink closed 2 years ago

missinglink commented 2 years ago

as discussed in https://github.com/smeijer/leaflet-geosearch/issues/297 this PR makes the bounds assertions more consistent.

I ended up writing it in a custom jest assertion called .toBeValidBounds() (there's also . toBeValidCoordinate() which is used internally but also exposed).

The issue we discussed about the antimeridian etc. is a bit out-of-scope, I had a look around for a module which would validate it and couldn't find anything, I may end up writing one myself at some point...

resolves https://github.com/smeijer/leaflet-geosearch/issues/297

smeijer commented 2 years ago

Looking great! Thanks.