@inrupt/jest-jsdom-polyfills
Advanced tools
Comparing version 1.3.0 to 1.3.1
16
index.js
@@ -36,4 +36,20 @@ // | ||
globalThis.TextDecoder = utils.TextDecoder; | ||
// TextEncoder references a Uint8Array constructor different than the global | ||
// one used by users in tests. The following enforces the same constructor to | ||
// be referenced by both. | ||
// FIXME: currently this doesn't work, and must be set in a custom environment. | ||
globalThis.Uint8Array = Uint8Array; | ||
} | ||
if ( | ||
typeof globalThis.crypto !== "undefined" && | ||
// jsdom doesn't implement the subtle Web Crypto API | ||
typeof globalThis.crypto.subtle === "undefined" | ||
) { | ||
// Requires OPENSSL_CONF=/dev/null (see https://github.com/nodejs/node/discussions/43184) | ||
const { Crypto, CryptoKey } = require("@peculiar/webcrypto"); | ||
Object.assign(globalThis.crypto, new Crypto()); | ||
globalThis.CryptoKey = CryptoKey; | ||
} | ||
// Node.js doesn't support Blob or File, so we're polyfilling those with | ||
@@ -40,0 +56,0 @@ // https://github.com/web-std/io |
{ | ||
"name": "@inrupt/jest-jsdom-polyfills", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "This package provides various polyfills needed on jest/jsdom when using the Inrupt SDKs", | ||
@@ -28,2 +28,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@peculiar/webcrypto": "^1.4.0", | ||
"@web-std/blob": "^3.0.4", | ||
@@ -35,3 +36,3 @@ "@web-std/file": "^3.0.2" | ||
}, | ||
"gitHead": "04f770c015d82f4a60b7a56726de69f9ddf230de" | ||
"gitHead": "122a1fbe9a22ce396fd90c03b96c9961d20229d5" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5557
59
3
+ Added@peculiar/webcrypto@^1.4.0
+ Added@peculiar/asn1-schema@2.3.13(transitive)
+ Added@peculiar/json-schema@1.1.12(transitive)
+ Added@peculiar/webcrypto@1.5.0(transitive)
+ Addedasn1js@3.0.5(transitive)
+ Addedpvtsutils@1.3.5(transitive)
+ Addedpvutils@1.1.3(transitive)
+ Addedtslib@2.7.0(transitive)
+ Addedwebcrypto-core@1.8.0(transitive)