diff --git a/package.json b/package.json index bb613e357..596ad5d57 100644 --- a/package.json +++ b/package.json @@ -105,8 +105,10 @@ "@types/mocha": "^10.0.6", "@types/node": "^22.0.0", "@types/semver": "^7.3.9", + "@types/ungap__structured-clone": "^1.2.0", "@typescript-eslint/eslint-plugin": "^8.0.1", "@typescript-eslint/parser": "^8.0.1", + "@ungap/structured-clone": "^1.2.0", "aws-sdk": "^2.1130.0", "benny": "^3.7.1", "c8": "^10.1.2", diff --git a/test/_common.ts b/test/_common.ts index 893dd8e89..5eb4b6ced 100644 --- a/test/_common.ts +++ b/test/_common.ts @@ -1,6 +1,12 @@ import * as gdal from 'gdal-async' +import structuredClone from '@ungap/structured-clone' console.log(`GDAL Version: ${gdal.version}, source: ${gdal.bundled ? 'bundled' : 'system library'}`) +if (!('structuredClone' in globalThis)) { + console.log('Using a JS implementation of structuredClone') + // eslint-disable-next-line @typescript-eslint/no-explicit-any + globalThis.structuredClone = structuredClone as any +} // gc tracing try { diff --git a/test/tsconfig.test.json b/test/tsconfig.test.json index e1676a168..f7d1a8706 100644 --- a/test/tsconfig.test.json +++ b/test/tsconfig.test.json @@ -2,6 +2,7 @@ "compilerOptions": { "downlevelIteration": true, "strict": true, - "strictNullChecks": true + "strictNullChecks": true, + "esModuleInterop": true } }