Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3027723
D7019.id23575.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
658 B
Referenced Files
None
Subscribers
None
D7019.id23575.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-typed 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
@@ -95,6 +95,9 @@
],
"moduleNameMapper": {
"\\.(css)$": "identity-obj-proxy"
- }
+ },
+ "setupFiles": [
+ "<rootDir>/jest-setup.js"
+ ]
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 22, 2:04 AM (5 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2339520
Default Alt Text
D7019.id23575.diff (658 B)
Attached To
Mode
D7019: [web] Fix missing WebCrypto mock in tests
Attached
Detach File
Event Timeline
Log In to Comment