codecharta-visualization 2.3.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/conf/jestEnvironment.js +3 -0
- package/conf/setupJestUnit.ts +14 -3
- package/dist/bundler/browser/chunk-6J2WBHT7.js +4192 -0
- package/dist/bundler/browser/{chunk-YCIMHKQ4.js → chunk-G73QOOPI.js} +1 -1
- package/dist/bundler/browser/index.html +7 -3
- package/dist/bundler/browser/main-2QGIUNMN.js +3570 -0
- package/dist/bundler/browser/package.json +1 -2
- package/package.json +1 -2
- package/dist/bundler/browser/chunk-DHAPNXGE.js +0 -4207
- package/dist/bundler/browser/main-I5D4IDD6.js +0 -3534
package/conf/jestEnvironment.js
CHANGED
|
@@ -6,6 +6,9 @@ class CustomJSDOMEnvironment extends JSDOMEnvironment {
|
|
|
6
6
|
|
|
7
7
|
// Expose Node.js structuredClone to jsdom global
|
|
8
8
|
this.global.structuredClone = structuredClone
|
|
9
|
+
|
|
10
|
+
// jsdom's crypto has no subtle, so expose Node.js Web Crypto digests
|
|
11
|
+
Object.defineProperty(this.global.crypto, "subtle", { value: globalThis.crypto.subtle, writable: true, configurable: true })
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
14
|
|
package/conf/setupJestUnit.ts
CHANGED
|
@@ -28,9 +28,9 @@ if (typeof globalThis.fetch === "undefined") {
|
|
|
28
28
|
) as any
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
// JSDOM implements neither Blob.text() nor File
|
|
32
|
-
// for years, so reading an uploaded file would reject in tests alone.
|
|
33
|
-
// it stands in.
|
|
31
|
+
// JSDOM implements neither Blob.text()/arrayBuffer() nor their File counterparts, which every browser
|
|
32
|
+
// the app runs in has had for years, so reading an uploaded file would reject in tests alone.
|
|
33
|
+
// FileReader is implemented, so it stands in.
|
|
34
34
|
if (typeof Blob.prototype.text === "undefined") {
|
|
35
35
|
Blob.prototype.text = function (this: Blob) {
|
|
36
36
|
return new Promise<string>((resolve, reject) => {
|
|
@@ -42,6 +42,17 @@ if (typeof Blob.prototype.text === "undefined") {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
if (typeof Blob.prototype.arrayBuffer === "undefined") {
|
|
46
|
+
Blob.prototype.arrayBuffer = function (this: Blob) {
|
|
47
|
+
return new Promise<ArrayBuffer>((resolve, reject) => {
|
|
48
|
+
const reader = new FileReader()
|
|
49
|
+
reader.onload = () => resolve(reader.result as ArrayBuffer)
|
|
50
|
+
reader.onerror = () => reject(reader.error)
|
|
51
|
+
reader.readAsArrayBuffer(this)
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
45
56
|
// JSDOM (nwsapi) does not implement the native Popover API or the :popover-open selector.
|
|
46
57
|
// Without zone.js swallowing the thrown error, components calling popover.matches(":popover-open")
|
|
47
58
|
// would fail tests. Make the selector match nothing and stub the popover methods.
|