Skip to content

Commit

Permalink
object tests
Browse files Browse the repository at this point in the history
  • Loading branch information
perrygeo committed Jul 7, 2016
1 parent 785ddf2 commit 55fcc2d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
5 changes: 4 additions & 1 deletion test/data/bad/bad-polygonloop.result-object
Original file line number Diff line number Diff line change
Expand Up @@ -1081,5 +1081,8 @@
},
{
"message": "a number was found where a coordinate array should have been found: this needs to be nested more deeply"
},
{
"message": "Polygons and MultiPolygons should follow the right-hand rule"
}
]
]
22 changes: 11 additions & 11 deletions test/hint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ test('geojsonhint', function(t) {
});
t.end();
});
// test('validates incorrect files as objects', function(t) {
// glob.sync('test/data/bad/*.geojson').forEach(function(f) {
// if (f === 'test/data/bad/bad-json.geojson') return;
// var gj = filejs(f);
// if (process.env.UPDATE) {
// fs.writeFileSync(f.replace('geojson', 'result-object'), JSON.stringify(geojsonhint.hint(gj), null, 2));
// }
// t.deepEqual(geojsonhint.hint(gj), filejs(f.replace('geojson', 'result-object')), f);
// });
// t.end();
// });
test('validates incorrect files as objects', function(t) {
glob.sync('test/data/bad/*.geojson').forEach(function(f) {
if (f === 'test/data/bad/bad-json.geojson') return;
var gj = filejs(f);
if (process.env.UPDATE) {
fs.writeFileSync(f.replace('geojson', 'result-object'), JSON.stringify(geojsonhint.hint(gj), null, 2));
}
t.deepEqual(geojsonhint.hint(gj), filejs(f.replace('geojson', 'result-object')), f);
});
t.end();
});
test('noDuplicateMembers option=false', function(t) {
t.deepEqual(geojsonhint.hint('{"type":"invalid","type":"Feature","properties":{},"geometry":null}', {
noDuplicateMembers: false
Expand Down

0 comments on commit 55fcc2d

Please sign in to comment.