Skip to content

Commit

Permalink
Merge branch 'master' into type-module
Browse files Browse the repository at this point in the history
  • Loading branch information
smallsaucepan authored Jan 17, 2024
2 parents 2864049 + 251b645 commit 0ce1c6e
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 236 deletions.
1 change: 0 additions & 1 deletion packages/turf-centroid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@types/benchmark": "^2.1.5",
"@types/tape": "^4.2.32",
"benchmark": "^2.1.4",
"geojson-fixtures": "*",
"glob": "^10.3.10",
"load-json-file": "^7.0.1",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/turf-circle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
"@mapbox/geojsonhint": "^3.2.0",
"@placemarkio/check-geojson": "^0.1.12",
"@turf/truncate": "workspace:^",
"@types/benchmark": "^2.1.5",
"@types/tape": "^4.2.32",
Expand Down
11 changes: 8 additions & 3 deletions packages/turf-circle/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { loadJsonFileSync } from "load-json-file";
import { writeJsonFileSync } from "write-json-file";
import { truncate } from "@turf/truncate";
import { featureCollection } from "@turf/helpers";
import geojsonhint from "@mapbox/geojsonhint";
import { circle } from "./index.js";
import { check } from "@placemarkio/check-geojson";
import { circle } from "./index";

const __dirname = path.dirname(fileURLToPath(import.meta.url));

Expand Down Expand Up @@ -46,6 +46,11 @@ test("turf-circle", (t) => {

test("turf-circle -- validate geojson", (t) => {
const C = circle([0, 0], 100);
geojsonhint.hint(C).forEach((hint) => t.fail(hint.message));
try {
check(JSON.stringify(C));
t.pass();
} catch (e) {
t.fail(e.message);
}
t.end();
});
2 changes: 1 addition & 1 deletion packages/turf-ellipse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"test:tape": "tsx test.ts"
},
"devDependencies": {
"@mapbox/geojsonhint": "^3.2.0",
"@placemarkio/check-geojson": "^0.1.12",
"@turf/bbox-polygon": "workspace:^",
"@turf/circle": "workspace:^",
"@turf/destination": "workspace:^",
Expand Down
9 changes: 7 additions & 2 deletions packages/turf-ellipse/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { loadJsonFileSync } from "load-json-file";
import { writeJsonFileSync } from "write-json-file";
import { circle } from "@turf/circle";
import { truncate } from "@turf/truncate";
import geojsonhint from "@mapbox/geojsonhint";
import { check } from "@placemarkio/check-geojson";
import { bboxPolygon } from "@turf/bbox-polygon";
import { rhumbDestination } from "@turf/rhumb-destination";
// import { destination } from '@turf/destination';
Expand Down Expand Up @@ -135,7 +135,12 @@ test("turf-ellipse -- with coordinates", (t) => {

test("turf-ellipse -- validate geojson", (t) => {
const E = ellipse([0, 0], 10, 20);
geojsonhint.hint(E).forEach((hint) => t.fail(hint.message));
try {
check(JSON.stringify(E));
t.pass();
} catch (e) {
t.fail(e.message);
}
t.end();
});

Expand Down
1 change: 0 additions & 1 deletion packages/turf-explode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@types/benchmark": "^2.1.5",
"@types/tape": "^4.2.32",
"benchmark": "^2.1.4",
"geojson-fixtures": "*",
"load-json-file": "^7.0.1",
"npm-run-all": "^4.1.5",
"tape": "^5.7.2",
Expand Down
10 changes: 1 addition & 9 deletions packages/turf-explode/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";
import tape from "tape";
import { all as fixtures } from "geojson-fixtures";
import { loadJsonFileSync } from "load-json-file";
import { writeJsonFileSync } from "write-json-file";
import { explode } from "./index.js";
Expand All @@ -14,14 +13,7 @@ const directories = {
out: path.join(__dirname, "test", "out") + path.sep,
};

// Save input fixtures
if (process.env.REGEN) {
Object.keys(fixtures).forEach((name) => {
writeJsonFileSync(directories.in + name + ".json", fixtures[name]);
});
}

tape("explode - geojson-fixtures", (t) => {
tape("explode - fixtures", (t) => {
fs.readdirSync(directories.in).forEach((filename) => {
const name = filename.replace(".json", "");
const features = loadJsonFileSync(directories.in + filename);
Expand Down
Loading

0 comments on commit 0ce1c6e

Please sign in to comment.