Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3033070
D7019.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
652 B
Referenced Files
None
Subscribers
None
D7019.id.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
Tue, Oct 22, 4:03 PM (20 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2339519
Default Alt Text
D7019.id.diff (652 B)
Attached To
Mode
D7019: [web] Fix missing WebCrypto mock in tests
Attached
Detach File
Event Timeline
Log In to Comment