Skip to content

Commit

Permalink
Test that string coords are parsed to numbers
Browse files Browse the repository at this point in the history
Refs #24
  • Loading branch information
Casey Thomas committed Sep 18, 2016
1 parent 475aecf commit 18ee34b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,5 +382,16 @@ describe('GeoJSON', function() {

expect(function(){ GeoJSON.parse(data, options); }).to.not.throwException();
});


it("converts string coordinates into numbers", function() {
var data = [{ lat: '39.343', lng: '-74.454'}];
var output = GeoJSON.parse(data, {Point: ['lat', 'lng']});

output.features.forEach(function(feature) {
expect(feature.geometry.coordinates[0]).to.be.a('number');
expect(feature.geometry.coordinates[1]).to.be.a('number');
});
});
});
});

0 comments on commit 18ee34b

Please sign in to comment.