From 522689f4392354999a8732ba782a4db5402fc540 Mon Sep 17 00:00:00 2001 From: Ni55aN Date: Sat, 20 Apr 2024 16:24:44 +0300 Subject: [PATCH 1/2] build: update cli --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index fcca1c6..ec7c57c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ }, "devDependencies": { "jest-environment-jsdom": "^29.1.2", - "rete-cli": "^1.0.2", + "rete-cli": "^1.0.3", "typescript": "4.8.4" } }, @@ -6424,9 +6424,9 @@ } }, "node_modules/rete-cli": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/rete-cli/-/rete-cli-1.0.2.tgz", - "integrity": "sha512-oHI2ui5kRs2aCLvlklNc9VNhHQZgGGZfFUe9Z2WHEe8bdXM24gjwcZc4MEkUvlFocPxyY65rfz3eEK7AiQnxEg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/rete-cli/-/rete-cli-1.0.3.tgz", + "integrity": "sha512-widMII5vMWuyuyP49ieSYCxfKfToFsni3kTWMZQDk1jeB97jgIcOW8umOXV9Wd6dJVeg2L2VRsSzyu0lYucTkw==", "dev": true, "dependencies": { "@babel/plugin-transform-runtime": "^7.21.4", diff --git a/package.json b/package.json index aeed77a..96aa407 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "jest-environment-jsdom": "^29.1.2", - "rete-cli": "^1.0.2", + "rete-cli": "^1.0.3", "typescript": "4.8.4" }, "dependencies": { From ce5bc045cf5edf819440f76ec104f742fc0bddca Mon Sep 17 00:00:00 2001 From: Ni55aN Date: Sat, 20 Apr 2024 16:29:37 +0300 Subject: [PATCH 2/2] test: fix mocks in node 20 --- test/mocks/crypto.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/mocks/crypto.ts b/test/mocks/crypto.ts index e248dbb..c76e5ad 100644 --- a/test/mocks/crypto.ts +++ b/test/mocks/crypto.ts @@ -3,7 +3,10 @@ import { Buffer } from 'buffer' export function mockCrypto(object: Record) { // eslint-disable-next-line no-undef - globalThis.crypto = object as unknown as Crypto + Object.defineProperty(globalThis, 'crypto', { + value: object, + writable: true + }) } export function mockCryptoFromArray(array: Uint8Array) { @@ -19,6 +22,10 @@ export function mockCryptoFromBuffer(buffer: Buffer) { } export function resetCrypto() { - // eslint-disable-next-line no-undef, no-undefined - globalThis.crypto = undefined as unknown as Crypto + // eslint-disable-next-line no-undef + Object.defineProperty(globalThis, 'crypto', { + // eslint-disable-next-line no-undefined + value: undefined, + writable: true + }) }