geojson-assert

0.0.2 • Public • Published

geojson-assert

thin wrapper around geojsonhint to allows you to easily use it to assertion test.

test object taken from chai, test data taken from geojsonhint.

install with npm

npm install geojson-assert

general usage

var assert = require('geojson-assert');
assert(geojson);

geojson-assert is somewhat less picky then geojsonhint and you can give it a str or an object.

If you pass true to the second argument it assumes you are passing a dict where values are valid geojson.

var assert = require('geojson-assert');
assert({
    thing1:geojson,
    thing2:moreGeoJson
}, true);

using it async in mocha

var assert = require('geojson-assert');
it('should work',function(done){
    fs.readFile('path to json',{encoding:'utf8'},function(err,result){
        if(err){
            return done(err);
        }
        done(assert(result));
    });
});

Readme

Keywords

none

Package Sidebar

Install

npm i geojson-assert

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • cwmma