From 15531e272c6e5c413f3798a43f579bd54e516139 Mon Sep 17 00:00:00 2001 From: James Beard Date: Sun, 22 Dec 2024 15:51:46 +1100 Subject: [PATCH] Removed accidentally committed temp file. --- packages/turf-union/test.ts.new | 101 -------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 packages/turf-union/test.ts.new diff --git a/packages/turf-union/test.ts.new b/packages/turf-union/test.ts.new deleted file mode 100644 index bade62bc32..0000000000 --- a/packages/turf-union/test.ts.new +++ /dev/null @@ -1,101 +0,0 @@ -import fs from "fs"; -import path from "path"; -import { fileURLToPath } from "url"; -import test from "tape"; -import { loadJsonFileSync } from "load-json-file"; -import { writeJsonFileSync } from "write-json-file"; -import { - type FeatureCollection, - type Polygon, - type MultiPolygon, -} from "geojson"; -import { union } from "./index.js"; - -const __dirname = path.dirname(fileURLToPath(import.meta.url)); - -const directories = { - in: path.join(__dirname, "test", "in") + path.sep, - out: path.join(__dirname, "test", "out") + path.sep, -}; - -const fixtures = fs.readdirSync(directories.in).map((filename) => { - return { - filename, - name: path.parse(filename).name, - geojson: loadJsonFileSync(directories.in + filename), - }; -}); - -test("union", function (t) { - for (const { name, geojson, filename } of fixtures) { - // Only test the input fixture if there is a corresponding fixture to compare. - if (fs.existsSync(path.join(directories.out, filename))) { - const result = union(geojson); - if (result === null) { - t.fail("result was null"); - } - - if (process.env.REGEN) - writeJsonFileSync(directories.out + filename, result); - t.deepEqual(result, loadJsonFileSync(directories.out + filename), name); - } - } - t.end(); -}); - -test("Unable to complete output ring ex 1 - issue 1983", function (t) { - const polys = loadJsonFileSync( - directories.in + "unable-to-complete-output-ring-1983-1.geojson" - ) as FeatureCollection; - - // This used to fail with "Unable to complete output ring starting at ..." - union(polys); - - t.end(); -}); - -test("Unable to complete output ring ex 2 - issue 1983", function (t) { - const polys = loadJsonFileSync( - directories.in + "unable-to-complete-output-ring-1983-2.geojson" - ) as FeatureCollection; - - // This used to fail with "Unable to complete output ring starting at ..." - union(polys); - - t.end(); -}); - -test("Maximum call stack size exceeded - issue 2317", function (t) { - const polys = loadJsonFileSync( - directories.in + "maximum-callstack-size-exceeded-2317.geojson" - ) as FeatureCollection; - - // This used to fail with "Maximum call stack size exceeded ..." - union(polys); - - t.end(); -}); - -test("Unable to find segment ex 1 - issue 2258", function (t) { - // Example from https://github.com/Turfjs/turf/issues/2258#issue-1125017544 - const polys = loadJsonFileSync( - directories.in + "unable-to-find-segment-2258-1.geojson" - ) as FeatureCollection; - - // This used to fail with "Unable to find segment ..." - union(polys); - - t.end(); -}); - -test("Unable to find segment ex 2 - issue 2258", function (t) { - // Example from https://github.com/Turfjs/turf/issues/2258#issuecomment-1635573555 - const polys = loadJsonFileSync( - directories.in + "unable-to-find-segment-2258-2.geojson" - ) as FeatureCollection; - - // This used to fail with "Unable to find segment ..." - union(polys); - - t.end(); -});