From adf399853ce27e941853c73d2873c3a1412c4749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Thu, 10 Oct 2024 16:41:47 +0200 Subject: [PATCH] Fix serving test data on windows --- test/geotiff.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/geotiff.spec.js b/test/geotiff.spec.js index bc2e23d1..ad6e2829 100644 --- a/test/geotiff.spec.js +++ b/test/geotiff.spec.js @@ -6,6 +6,7 @@ import serveStatic from 'serve-static'; import finalhandler from 'finalhandler'; import AbortController from 'node-abort-controller'; import { dirname } from 'path'; +import { fileURLToPath } from 'url'; import { GeoTIFF, fromArrayBuffer, writeArrayBuffer, fromUrls, Pool } from '../dist-module/geotiff.js'; import { makeFetchSource } from '../dist-module/source/remote.js'; @@ -15,9 +16,9 @@ import { chunk, toArray, toArrayRecursively, range } from '../dist-module/utils. import DataSlice from '../dist-module/dataslice.js'; import DataView64 from '../dist-module/dataview64.js'; -const __dirname = dirname(new URL(import.meta.url).pathname); +const __dirname = dirname(fileURLToPath(import.meta.url)); -// Set up a node server to make tiffs available at localhost:3000/test/data, and a worker pool +// Set up a node server to make tiffs available at localhost:3000/data, and a worker pool let server = null; let pool = null; before(async () => {