Skip to content

Commit 13b610e

Browse files
committed
f
1 parent 2c16d5d commit 13b610e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"test": "npm run lint -- --fix && vitest run",
4040
"test-keepalive": "cross-env TEST_KEEPALIVE_COUNT=50 vitest run --test-timeout 180000 keep-alive-header.test.ts",
4141
"test-node16": "node examples/httpclient.cjs && node examples/search_github.cjs && node examples/timing.cjs",
42-
"cov": "cross-env NODE_OPTIONS='--loader=./test/patch-structuredClone.mjs' vitest run --coverage",
42+
"cov": "cross-env NODE_OPTIONS='--require ./test/patch-structuredClone.cjs' vitest run --coverage",
4343
"ci": "npm run lint && npm run cov && npm run prepublishOnly && npm pack && attw --pack",
4444
"clean": "rm -rf dist",
4545
"prepublishOnly": "npm run build"

test/patch-structuredClone.cjs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const structuredClone = require('@ungap/structured-clone').default;
2+
3+
// vitest require structuredClone
4+
if (!('structuredClone' in globalThis)) {
5+
globalThis.structuredClone = structuredClone;
6+
// console.debug('patched structuredClone for Node.js %s', process.version);
7+
}

test/patch-structuredClone.mjs

-6
This file was deleted.

0 commit comments

Comments
 (0)