diff --git a/packages/kit/src/runtime/server/page/csp.spec.js b/packages/kit/src/runtime/server/page/csp.spec.js index 9747053dae67..66ea28085d2c 100644 --- a/packages/kit/src/runtime/server/page/csp.spec.js +++ b/packages/kit/src/runtime/server/page/csp.spec.js @@ -2,8 +2,11 @@ import { webcrypto } from 'node:crypto'; import { assert, beforeAll, test } from 'vitest'; import { Csp } from './csp.js'; -// @ts-expect-error -globalThis.crypto = webcrypto; +// TODO: remove after bumping peer dependency to require Node 20 +if (!globalThis.crypto) { + // @ts-expect-error + globalThis.crypto = webcrypto; +} beforeAll(() => { // @ts-expect-error