geojsonhint
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -0,1 +1,6 @@ | ||
## 0.3.0 | ||
* Now uses `tap` for tests | ||
* Modernized binary supports streams | ||
## 0.2.0 | ||
@@ -2,0 +7,0 @@ |
{ | ||
"name": "geojsonhint", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "validate and sanity-check geojson files", | ||
@@ -10,5 +10,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"expect.js": "~0.2.0", | ||
"mocha": "~1.12.0", | ||
"glob": "~3.2.6" | ||
"glob": "~3.2.6", | ||
"fuzzer": "~0.1.0" | ||
}, | ||
@@ -19,3 +18,3 @@ "bin": { | ||
"scripts": { | ||
"test": "mocha -R spec" | ||
"test": "tap test/*.js" | ||
}, | ||
@@ -38,4 +37,7 @@ "repository": { | ||
"optimist": "~0.6.0", | ||
"colors": "~0.6.0-1" | ||
"colors": "~0.6.0-1", | ||
"tap": "~0.4.8", | ||
"minimist": "0.0.8", | ||
"concat-stream": "~1.4.4" | ||
} | ||
} |
@@ -1,4 +0,5 @@ | ||
var expect = require('expect.js'), | ||
var test = require('tap').test, | ||
fs = require('fs'), | ||
glob = require('glob'), | ||
fuzzer = require('fuzzer'), | ||
geojsonhint = require('../'); | ||
@@ -14,51 +15,50 @@ | ||
describe('geojsonhint', function() { | ||
describe('validates correct files', function(done) { | ||
glob.sync('test/data/good/*.geojson').forEach(function(f) { | ||
it('validates ' + f, function() { | ||
var gj = file(f); | ||
expect(geojsonhint.hint(gj)).to.eql([]); | ||
}); | ||
test('geojsonhint', function(t) { | ||
glob.sync('test/data/good/*.geojson').forEach(function(f) { | ||
var gj = file(f); | ||
t.deepEqual(geojsonhint.hint(gj), [], 'good input: ' + f); | ||
}); | ||
t.deepEqual(geojsonhint.hint(undefined), [{ | ||
message: 'Expected string input', | ||
line: 0 | ||
}]); | ||
t.deepEqual(geojsonhint.hint('{}'), [{ | ||
message: 'The type property is required and was not found', | ||
line: 1 | ||
}]); | ||
test('validates incorrect files', function(t) { | ||
glob.sync('test/data/bad/*.geojson').forEach(function(f) { | ||
var gj = file(f); | ||
t.deepEqual(geojsonhint.hint(gj), filejs(f.replace('geojson', 'result'))); | ||
}); | ||
t.end(); | ||
}); | ||
it('requires an input', function() { | ||
expect(geojsonhint.hint(undefined)).to.eql([{ | ||
message: 'Expected string input', | ||
test('invalid roots', function(t) { | ||
t.deepEqual(geojsonhint.hint('null'), [{ | ||
message: 'The root of a GeoJSON object must be an object.', | ||
line: 0 | ||
}]); | ||
}); | ||
it('requires a root type', function() { | ||
expect(geojsonhint.hint('{}')).to.eql([{ | ||
message: 'The type property is required and was not found', | ||
line: 1 | ||
t.deepEqual(geojsonhint.hint('1'), [{ | ||
message: 'The root of a GeoJSON object must be an object.', | ||
line: 0 | ||
}]); | ||
t.deepEqual(geojsonhint.hint('"string"'), [{ | ||
message: 'The root of a GeoJSON object must be an object.', | ||
line: 0 | ||
}]); | ||
t.end(); | ||
}); | ||
describe('validates incorrect files', function() { | ||
glob.sync('test/data/bad/*.geojson').forEach(function(f) { | ||
it('invalidates ' + f, function() { | ||
var gj = file(f); | ||
expect(geojsonhint.hint(gj)).to.eql(filejs(f.replace('geojson', 'result'))); | ||
}); | ||
}); | ||
glob.sync('test/data/good/*.geojson').forEach(function(f) { | ||
var mutator = fuzzer.mutate.object(filejs(f)); | ||
for (var i = 0; i < 100; i++) { | ||
try { | ||
var input = mutator(); | ||
geojsonhint.hint(input); | ||
t.ok('done'); | ||
} catch(e) { | ||
t.fail('exception on ' + JSON.stringify(input)); | ||
} | ||
} | ||
}); | ||
describe('invalid roots', function() { | ||
it('null', function() { | ||
expect(geojsonhint.hint('null')).to.eql([{ | ||
message: 'The root of a GeoJSON object must be an object.', | ||
line: 0 | ||
}]); | ||
}); | ||
it('number', function() { | ||
expect(geojsonhint.hint('1')).to.eql([{ | ||
message: 'The root of a GeoJSON object must be an object.', | ||
line: 0 | ||
}]); | ||
}); | ||
it('string', function() { | ||
expect(geojsonhint.hint('"string"')).to.eql([{ | ||
message: 'The root of a GeoJSON object must be an object.', | ||
line: 0 | ||
}]); | ||
}); | ||
}); | ||
t.end(); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
152450
2
72
0
0
6
+ Addedconcat-stream@~1.4.4
+ Addedminimist@0.0.8
+ Addedtap@~0.4.8
+ Addedabbrev@1.1.1(transitive)
+ Addedarray-buffer-byte-length@1.0.1(transitive)
+ Addedarraybuffer.prototype.slice@1.0.3(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedbuffer-equal@0.0.2(transitive)
+ Addedbunker@0.1.2(transitive)
+ Addedburrito@0.2.12(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcharm@0.1.2(transitive)
+ Addedconcat-stream@1.4.11(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddata-view-buffer@1.0.1(transitive)
+ Addeddata-view-byte-length@1.0.1(transitive)
+ Addeddata-view-byte-offset@1.0.0(transitive)
+ Addeddeep-equal@0.0.0(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddifflet@0.2.6(transitive)
+ Addedes-abstract@1.23.3(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedes-set-tostringtag@2.0.3(transitive)
+ Addedes-to-primitive@1.2.1(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedfunction.prototype.name@1.1.6(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedget-symbol-description@1.0.2(transitive)
+ Addedglob@3.2.11(transitive)
+ Addedglobalthis@1.0.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-bigints@1.0.2(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinternal-slot@1.0.7(transitive)
+ Addedis-array-buffer@3.0.4(transitive)
+ Addedis-bigint@1.0.4(transitive)
+ Addedis-boolean-object@1.1.2(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-data-view@1.0.1(transitive)
+ Addedis-date-object@1.0.5(transitive)
+ Addedis-negative-zero@2.0.3(transitive)
+ Addedis-number-object@1.0.7(transitive)
+ Addedis-regex@1.1.4(transitive)
+ Addedis-shared-array-buffer@1.0.3(transitive)
+ Addedis-string@1.0.7(transitive)
+ Addedis-symbol@1.0.4(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedis-weakref@1.0.2(transitive)
+ Addedisarray@0.0.12.0.5(transitive)
+ Addedlru-cache@2.7.3(transitive)
+ Addedminimatch@0.3.0(transitive)
+ Addedminimist@0.0.81.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addednopt@2.2.1(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.5(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedreadable-stream@1.1.14(transitive)
+ Addedregexp.prototype.flags@1.5.3(transitive)
+ Addedrunforcover@0.0.2(transitive)
+ Addedsafe-array-concat@1.1.2(transitive)
+ Addedsafe-regex-test@1.0.3(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-function-name@2.0.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedsigmund@1.0.1(transitive)
+ Addedslide@1.1.6(transitive)
+ Addedstring.prototype.trim@1.2.9(transitive)
+ Addedstring.prototype.trimend@1.0.8(transitive)
+ Addedstring.prototype.trimstart@1.0.8(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedtap@0.4.13(transitive)
+ Addedtraverse@0.5.20.6.10(transitive)
+ Addedtyped-array-buffer@1.0.2(transitive)
+ Addedtyped-array-byte-length@1.0.1(transitive)
+ Addedtyped-array-byte-offset@1.0.2(transitive)
+ Addedtyped-array-length@1.0.6(transitive)
+ Addedtypedarray@0.0.7(transitive)
+ Addedtypedarray.prototype.slice@1.0.3(transitive)
+ Addeduglify-js@1.1.1(transitive)
+ Addedunbox-primitive@1.0.2(transitive)
+ Addedwhich-boxed-primitive@1.0.2(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
+ Addedyamlish@0.0.7(transitive)
- Removedminimist@0.0.10(transitive)