Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('addendum: partially corrupted', function(t) {
var example = [{
'_id': 'whosonfirst:continent:6295630',
'source': 'whosonfirst',
'layer': 'continent',
'name': {
'default': 'Earth'
},
'center_point': {
'lon': 0,
'lat': 0
},
'addendum': {
'wikipedia': codec.encode({ slug: 'HackneyCityFarm' }),
'geonames': 'INVALID ENCODING'
}
}];
let collection = geojsonify({}, example);
t.deepEqual(collection.features[0].properties.addendum, {
wikipedia: { slug: 'HackneyCityFarm' }
});
t.end();
});
test('addendum: all corrupted', function(t) {
test('addendum: set in source', function(t) {
var example = [{
'_id': 'whosonfirst:continent:6295630',
'source': 'whosonfirst',
'layer': 'continent',
'name': {
'default': 'Earth'
},
'center_point': {
'lon': 0,
'lat': 0
},
'addendum': {
'wikipedia': codec.encode({ slug: 'HackneyCityFarm' }),
'geonames': codec.encode({ foreignkey: 1 })
}
}];
let collection = geojsonify({}, example);
t.deepEqual(collection.features[0].properties.addendum, {
wikipedia: { slug: 'HackneyCityFarm' },
geonames: { foreignkey: 1 }
});
t.end();
});