Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix npmignore situation, standardize fixture location #363

Merged
merged 1 commit into from
Apr 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/turf-along/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-bbox-polygon/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-bbox/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
12 changes: 6 additions & 6 deletions packages/turf-bbox/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ global.bbox2 = require('./index-lazy-reduce');
var Benchmark = require('benchmark');
var fs = require('fs');

global.fc = require('./geojson/FeatureCollection');
global.pt = require('./geojson/Point');
global.line = require('./geojson/LineString');
global.poly = require('./geojson/Polygon');
global.multiLine = require('./geojson/MultiLineString');
global.multiPoly = require('./geojson/MultiPolygon');
global.fc = require('./test/FeatureCollection');
global.pt = require('./test/Point');
global.line = require('./test/LineString');
global.poly = require('./test/Polygon');
global.multiLine = require('./test/MultiLineString');
global.multiPoly = require('./test/MultiPolygon');

var suite = new Benchmark.Suite('turf-bbox');
suite
Expand Down
12 changes: 6 additions & 6 deletions packages/turf-bbox/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ var fs = require('fs');
var extent = require('./');

// test data
var fc = require('./geojson/FeatureCollection');
var pt = require('./geojson/Point');
var line = require('./geojson/LineString');
var poly = require('./geojson/Polygon');
var multiLine = require('./geojson/MultiLineString');
var multiPoly = require('./geojson/MultiPolygon');
var fc = require('./test/FeatureCollection');
var pt = require('./test/Point');
var line = require('./test/LineString');
var poly = require('./test/Polygon');
var multiLine = require('./test/MultiLineString');
var multiPoly = require('./test/MultiPolygon');

test('extent', function(t){
// FeatureCollection
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/turf-bearing/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-bezier/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
4 changes: 2 additions & 2 deletions packages/turf-bezier/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var bezier = require('./');
var Benchmark = require('benchmark');
var fs = require('fs');

var line = JSON.parse(fs.readFileSync(__dirname+'/fixture/bezierIn.geojson'));
var line = JSON.parse(fs.readFileSync(__dirname+'/test/bezierIn.geojson'));

var suite = new Benchmark.Suite('turf-bezier');
suite
Expand All @@ -15,4 +15,4 @@ suite
.on('complete', function () {

})
.run();
.run();
2 changes: 1 addition & 1 deletion packages/turf-bezier/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var bezier = require('./'),
fs = require('fs');

test('bezier', function(t) {
var lineIn = JSON.parse(fs.readFileSync(__dirname+'/fixture/bezierIn.geojson'));
var lineIn = JSON.parse(fs.readFileSync(__dirname+'/test/bezierIn.geojson'));
var syncLineOut = bezier(lineIn, 5000, .85);
if (syncLineOut instanceof Error) throw syncLineOut;
t.ok(syncLineOut);
Expand Down
2 changes: 2 additions & 0 deletions packages/turf-buffer/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-center/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
6 changes: 3 additions & 3 deletions packages/turf-center/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var center = require('./');
var Benchmark = require('benchmark');
var fs = require('fs');

var boxFC = JSON.parse(fs.readFileSync(__dirname+'/fixtures/in/box.geojson'));
var blockFC = JSON.parse(fs.readFileSync(__dirname+'/fixtures/in/block.geojson'));
var boxFC = JSON.parse(fs.readFileSync(__dirname+'/test/in/box.geojson'));
var blockFC = JSON.parse(fs.readFileSync(__dirname+'/test/in/block.geojson'));

var suite = new Benchmark.Suite('turf-center');
suite
Expand All @@ -19,4 +19,4 @@ suite
.on('complete', function () {

})
.run();
.run();
8 changes: 4 additions & 4 deletions packages/turf-center/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var test = require('tape');
var center = require('./');
var fs = require('fs');

var boxFC = JSON.parse(fs.readFileSync(__dirname+'/fixtures/in/box.geojson'));
var blockFC = JSON.parse(fs.readFileSync(__dirname+'/fixtures/in/block.geojson'));
var boxFC = JSON.parse(fs.readFileSync(__dirname+'/test/in/box.geojson'));
var blockFC = JSON.parse(fs.readFileSync(__dirname+'/test/in/block.geojson'));

test('center', function(t){
var boxFcCenter = center(boxFC);
Expand All @@ -18,8 +18,8 @@ test('center', function(t){

boxFC.features.push(boxFcCenter);
blockFC.features.push(blockFcCenter);
fs.writeFileSync(__dirname+'/fixtures/out/box_out.geojson', JSON.stringify(boxFC,null,2));
fs.writeFileSync(__dirname+'/fixtures/out/block_out.geojson', JSON.stringify(blockFC,null,2));
fs.writeFileSync(__dirname+'/test/out/box_out.geojson', JSON.stringify(boxFC,null,2));
fs.writeFileSync(__dirname+'/test/out/block_out.geojson', JSON.stringify(blockFC,null,2));

t.end();
});
1 change: 1 addition & 0 deletions packages/turf-centroid/.npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test
coverage
6 changes: 3 additions & 3 deletions packages/turf-centroid/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var centroid = require('./');
var Benchmark = require('benchmark');
var fs = require('fs');

var boxFC = JSON.parse(fs.readFileSync(__dirname+'/fixtures/in/box.geojson'));
var blockFC = JSON.parse(fs.readFileSync(__dirname+'/fixtures/in/block.geojson'));
var boxFC = JSON.parse(fs.readFileSync(__dirname+'/test/in/box.geojson'));
var blockFC = JSON.parse(fs.readFileSync(__dirname+'/test/in/block.geojson'));

var suite = new Benchmark.Suite('turf-centroid');
suite
Expand All @@ -19,4 +19,4 @@ suite
.on('complete', function () {

})
.run();
.run();
2 changes: 2 additions & 0 deletions packages/turf-collect/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-combine/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-concave/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
4 changes: 2 additions & 2 deletions packages/turf-concave/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var concave = require('./');
var Benchmark = require('benchmark');
var fs = require('fs');

var pts1 = JSON.parse(fs.readFileSync(__dirname+'/fixtures/in/pts1.geojson'));
var pts2 = JSON.parse(fs.readFileSync(__dirname+'/fixtures/in/pts2.geojson'));
var pts1 = JSON.parse(fs.readFileSync(__dirname+'/test/in/pts1.geojson'));
var pts2 = JSON.parse(fs.readFileSync(__dirname+'/test/in/pts2.geojson'));

var suite = new Benchmark.Suite('turf-concave');
suite
Expand Down
2 changes: 2 additions & 0 deletions packages/turf-convex/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-destination/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-difference/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-distance/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-envelope/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
4 changes: 2 additions & 2 deletions packages/turf-envelope/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var envelope = require('./');
var Benchmark = require('benchmark');
var fs = require('fs');

var fixture = require('./geojson/fc.js');
var fixture = require('./test/fc.js');
var suite = new Benchmark.Suite('turf-envelope');
suite
.add('turf-envelope',function () {
Expand All @@ -14,4 +14,4 @@ suite
.on('complete', function () {

})
.run();
.run();
2 changes: 1 addition & 1 deletion packages/turf-envelope/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var test = require('tape');
var envelope = require('./');
var fc = require('./test/geojson/fc.json');
var fc = require('./test/test/fc.json');

test('envelope', function(t){
var enveloped = envelope(fc);
Expand Down
2 changes: 2 additions & 0 deletions packages/turf-flip/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-helpers/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-hex-grid/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
16 changes: 8 additions & 8 deletions packages/turf-hex-grid/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ test('hex-grid', function (t) {
grid3.features.push(referencePoly(bbox3));
grid4.features.push(referencePoly(bbox4));

fs.writeFileSync(__dirname+'/fixtures/out/grid1.geojson', JSON.stringify(grid1,null,2));
fs.writeFileSync(__dirname+'/fixtures/out/grid2.geojson', JSON.stringify(grid2,null,2));
fs.writeFileSync(__dirname+'/fixtures/out/grid3.geojson', JSON.stringify(grid3,null,2));
fs.writeFileSync(__dirname+'/fixtures/out/grid4.geojson', JSON.stringify(grid4,null,2));
fs.writeFileSync(__dirname+'/test/out/grid1.geojson', JSON.stringify(grid1,null,2));
fs.writeFileSync(__dirname+'/test/out/grid2.geojson', JSON.stringify(grid2,null,2));
fs.writeFileSync(__dirname+'/test/out/grid3.geojson', JSON.stringify(grid3,null,2));
fs.writeFileSync(__dirname+'/test/out/grid4.geojson', JSON.stringify(grid4,null,2));

t.end();
});
Expand Down Expand Up @@ -109,10 +109,10 @@ test('hex-tri-grid', function (t) {
grid3.features.push(referencePoly(bbox3));
grid4.features.push(referencePoly(bbox4));

fs.writeFileSync(__dirname+'/fixtures/out/trigrid1.geojson', JSON.stringify(grid1,null,2));
fs.writeFileSync(__dirname+'/fixtures/out/trigrid2.geojson', JSON.stringify(grid2,null,2));
fs.writeFileSync(__dirname+'/fixtures/out/trigrid3.geojson', JSON.stringify(grid3,null,2));
fs.writeFileSync(__dirname+'/fixtures/out/trigrid4.geojson', JSON.stringify(grid4,null,2));
fs.writeFileSync(__dirname+'/test/out/trigrid1.geojson', JSON.stringify(grid1,null,2));
fs.writeFileSync(__dirname+'/test/out/trigrid2.geojson', JSON.stringify(grid2,null,2));
fs.writeFileSync(__dirname+'/test/out/trigrid3.geojson', JSON.stringify(grid3,null,2));
fs.writeFileSync(__dirname+'/test/out/trigrid4.geojson', JSON.stringify(grid4,null,2));

t.end();
});
Expand Down
2 changes: 2 additions & 0 deletions packages/turf-inside/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
4 changes: 2 additions & 2 deletions packages/turf-inside/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test('poly with hole', function (t) {
var ptInHole = point([-86.69208526611328, 36.20373274711739]);
var ptInPoly = point([-86.72229766845702, 36.20258997094334]);
var ptOutsidePoly = point([-86.75079345703125, 36.18527313913089]);
var polyHole = JSON.parse(fs.readFileSync(__dirname + '/fixtures/poly-with-hole.geojson'));
var polyHole = JSON.parse(fs.readFileSync(__dirname + '/test/poly-with-hole.geojson'));

t.false(inside(ptInHole, polyHole));
t.true(inside(ptInPoly, polyHole));
Expand All @@ -52,7 +52,7 @@ test('multipolygon with hole', function (t) {
var ptInPoly = point([-86.72229766845702, 36.20258997094334]);
var ptInPoly2 = point([-86.75079345703125, 36.18527313913089]);
var ptOutsidePoly = point([-86.75302505493164, 36.23015046460186]);
var multiPolyHole = JSON.parse(fs.readFileSync(__dirname + '/fixtures/multipoly-with-hole.geojson'));
var multiPolyHole = JSON.parse(fs.readFileSync(__dirname + '/test/multipoly-with-hole.geojson'));

t.false(inside(ptInHole, multiPolyHole));
t.true(inside(ptInPoly, multiPolyHole));
Expand Down
2 changes: 2 additions & 0 deletions packages/turf-intersect/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-invariant/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-isolines/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
4 changes: 2 additions & 2 deletions packages/turf-isolines/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var isolines = require('./');
var Benchmark = require('benchmark');
var fs = require('fs');

var points = JSON.parse(fs.readFileSync(__dirname+'/geojson/Points.geojson'));
var points = JSON.parse(fs.readFileSync(__dirname+'/test/Points.geojson'));

var suite = new Benchmark.Suite('turf-isolines');
suite
Expand All @@ -15,4 +15,4 @@ suite
.on('complete', function () {

})
.run();
.run();
4 changes: 2 additions & 2 deletions packages/turf-isolines/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ var path = require('path');
var isolines = require('./');

test('isolines', function (t) {
var points = JSON.parse(fs.readFileSync(path.join(__dirname, 'geojson/Points.geojson')));
var points = JSON.parse(fs.readFileSync(path.join(__dirname, 'test/Points.geojson')));

var isolined = isolines(points, 'elevation', 15, [25, 45, 55, 65, 85, 95, 105, 120, 180]);

t.ok(isolined.features, 'should take a set of points with z values and output a set of contour lines');
t.equal(isolined.features[0].geometry.type, 'LineString');

fs.writeFileSync(path.join(__dirname, 'geojson/isolines.geojson'), JSON.stringify(isolined));
fs.writeFileSync(path.join(__dirname, 'test/isolines.geojson'), JSON.stringify(isolined));
t.end();
});
2 changes: 2 additions & 0 deletions packages/turf-kinks/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
2 changes: 2 additions & 0 deletions packages/turf-line-distance/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
6 changes: 3 additions & 3 deletions packages/turf-line-distance/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ var line = {
}
};

var route1 = JSON.parse(fs.readFileSync(__dirname + '/fixtures/route1.geojson'));
var route2 = JSON.parse(fs.readFileSync(__dirname + '/fixtures/route2.geojson'));
var route1 = JSON.parse(fs.readFileSync(__dirname + '/test/route1.geojson'));
var route2 = JSON.parse(fs.readFileSync(__dirname + '/test/route2.geojson'));

var suite = new Benchmark.Suite('turf-line-distance');
suite
Expand All @@ -56,4 +56,4 @@ suite
.on('complete', function () {

})
.run();
.run();
10 changes: 5 additions & 5 deletions packages/turf-line-distance/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var test = require('tape');
var fs = require('fs');
var lineDistance = require('./');

var route1 = JSON.parse(fs.readFileSync(__dirname + '/fixtures/route1.geojson'));
var route2 = JSON.parse(fs.readFileSync(__dirname + '/fixtures/route2.geojson'));
var route1 = JSON.parse(fs.readFileSync(__dirname + '/test/route1.geojson'));
var route2 = JSON.parse(fs.readFileSync(__dirname + '/test/route2.geojson'));

test('LineString', function (t) {
t.equal(Math.round(lineDistance(route1, 'miles')), 202);
Expand All @@ -21,19 +21,19 @@ test('turf-line-distance with geometries', function (t) {
});

test('Polygon', function (t) {
var feat = JSON.parse(fs.readFileSync(__dirname + '/fixtures/polygon.geojson'));
var feat = JSON.parse(fs.readFileSync(__dirname + '/test/polygon.geojson'));
t.equal(Math.round(1000 * lineDistance(feat, 'kilometers')), 5599);
t.end();
})

test('MultiLineString', function (t) {
var feat = JSON.parse(fs.readFileSync(__dirname + '/fixtures/multilinestring.geojson'));
var feat = JSON.parse(fs.readFileSync(__dirname + '/test/multilinestring.geojson'));
t.equal(Math.round(1000 * lineDistance(feat, 'kilometers')), 4705);
t.end();
})

test('FeatureCollection', function (t) {
var feat = JSON.parse(fs.readFileSync(__dirname + '/fixtures/featurecollection.geojson'));
var feat = JSON.parse(fs.readFileSync(__dirname + '/test/featurecollection.geojson'));
t.equal(Math.round(1000 * lineDistance(feat, 'kilometers')), 10304);
t.end();
})
2 changes: 2 additions & 0 deletions packages/turf-line-slice/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
8 changes: 4 additions & 4 deletions packages/turf-line-slice/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ var Benchmark = require('benchmark');
var fs = require('fs');
var point = require('turf-helpers').point;

var route1 = JSON.parse(fs.readFileSync(__dirname + '/fixtures/in/route1.geojson'));
var route2 = JSON.parse(fs.readFileSync(__dirname + '/fixtures/in/route2.geojson'));
var line1 = JSON.parse(fs.readFileSync(__dirname + '/fixtures/in/line1.geojson'));
var route1 = JSON.parse(fs.readFileSync(__dirname + '/test/in/route1.geojson'));
var route2 = JSON.parse(fs.readFileSync(__dirname + '/test/in/route2.geojson'));
var line1 = JSON.parse(fs.readFileSync(__dirname + '/test/in/line1.geojson'));

var start1 = point([-97.79617309570312,22.254624939561698]);
var stop1 = point([-97.72750854492188,22.057641623615734]);
Expand All @@ -31,4 +31,4 @@ suite
.on('complete', function () {

})
.run();
.run();
Loading