Leaflet: Tests for GeoJSON functions required

Created on 18 Apr 2020  路  4Comments  路  Source: Leaflet/Leaflet

None of following GeoJSON functions are covered with tests yet:

  • [ ] geometryToLayer
  • [ ] coordsToLatLng
  • [ ] coordsToLatLngs
  • [ ] latLngToCoords
  • [ ] latLngsToCoords
  • [ ] asFeature

Sample test (for latLngToCoords):

describe("L.GeoJSON functions", function () {
    it("L.GeoJSON.latLngToCoords", function () {
        // todo: check alt too
        var arrLatLng = [-1.4837191022531273, 43.49222084042808];
        var arrLngLat = [arrLatLng[1], arrLatLng[0]];
        var latLng = L.latLng(arrLatLng);

        expect(L.GeoJSON.latLngToCoords(latLng)).to.eql([43.492221, -1.483719]);
        expect(L.GeoJSON.latLngToCoords(latLng, 0)).to.eql([43, -1]);
        // expect(L.GeoJSON.latLngToCoords(latLng, false)).to.eql(arrLngLat); // after #7100
    });

    // etc
});
tests

Most helpful comment

i opened a pull request (#7147) in may, which after an initial discussion did not get further attention. So maybe someone could review it?! @johnd0e @mourner ?

All 4 comments

@johnd0e i opened a ready-for-review pull request that adds the respective tests.

If this is still open could I have a crack at it for hacktoberfest?
Ta

Can I work on this?

i opened a pull request (#7147) in may, which after an initial discussion did not get further attention. So maybe someone could review it?! @johnd0e @mourner ?

Was this page helpful?
0 / 5 - 0 ratings