Skip to content

Commit 98bd384

Browse files
author
Nick Doiron
committed
test empty shapefiles
1 parent 78cf861 commit 98bd384

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

files/empty-shp.zip

1.2 KB
Binary file not shown.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"lie": "^3.0.1",
2727
"lru-cache": "^2.7.0",
2828
"mocha": "^2.3.3",
29-
"parsedbf": "0.1.1",
29+
"parsedbf": "0.1.2",
3030
"proj4": "^2.1.4",
3131
"testling": "^1.6.1",
3232
"uglify-js": "^2.4.24"

test/test.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ describe('Shp', function(){
102102
return pandr.then(function(a){return a.features}).should.eventually.have.length(361);
103103
});
104104
});
105+
describe('empty attributes table', function(){
106+
var pandr = shp('http://localhost:3000/files/empty-shp.zip');
107+
it('should have the right keys', function(){
108+
return pandr.should.eventually.contain.keys('type', 'features');
109+
});
110+
it('should be the right type',function(){
111+
return pandr.should.eventually.have.property('type', 'FeatureCollection');
112+
});
113+
it('should have the right number of features',function(){
114+
return pandr.then(function(a){return a.features}).should.eventually.have.length(2);
115+
});
116+
});
105117
describe('errors', function(){
106118
it('bad file should be rejected', function(){
107119
return shp('http://localhost:3000/test/data/bad').should.be.rejected;
@@ -120,5 +132,4 @@ describe('Shp', function(){
120132
return shp('http://localhost:3000/test/data/noshp.zip').should.be.rejected;
121133
});
122134
});
123-
124-
});
135+
});

0 commit comments

Comments
 (0)