Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32210175
D7019.1765129773.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
652 B
Referenced Files
None
Subscribers
None
D7019.1765129773.diff
View Options
diff --git a/web/jest-setup.js b/web/jest-setup.js
new file mode 100644
--- /dev/null
+++ b/web/jest-setup.js
@@ -0,0 +1,8 @@
+// @flow
+
+import crypto from 'crypto';
+
+// crypto.webcrypto was introduced in Node 15.10.0.
+// It is not defined in Flow so we need a cast
+// eslint-disable-next-line no-undef -- "global is not defined"
+global.crypto = (crypto: any).webcrypto;
diff --git a/web/package.json b/web/package.json
--- a/web/package.json
+++ b/web/package.json
@@ -97,6 +97,9 @@
],
"moduleNameMapper": {
"\\.(css)$": "identity-obj-proxy"
- }
+ },
+ "setupFiles": [
+ "<rootDir>/jest-setup.js"
+ ]
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 5:49 PM (16 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5841731
Default Alt Text
D7019.1765129773.diff (652 B)
Attached To
Mode
D7019: [web] Fix missing WebCrypto mock in tests
Attached
Detach File
Event Timeline
Log In to Comment