Files
iD/test/spec/GeoJSON.js
2012-12-03 15:11:49 -05:00

15 lines
548 B
JavaScript

describe('GeoJSON', function() {
describe('#mapping', function() {
it('should be able to map a node to geojson', function() {
expect(iD.format.GeoJSON.mapping({ type: 'node', lat: 38, lon: -77 }).geometry.type).to.equal('Point');
});
it('should be able to map a way to geojson', function() {
var way = { type: 'way', nodes: [] };
var gj = iD.format.GeoJSON.mapping(way);
expect(gj.type).to.equal('Feature');
expect(gj.geometry.type).to.equal('LineString');
});
});
});