Skip to content

Commit b7811cb

Browse files
committed
polyfill missing crypto function for tests
1 parent 96ad333 commit b7811cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

plugins/backend/src/setupTests.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
* © 2022 Thoughtworks, Inc.
33
*/
44

5-
export {}
5+
import crypto from 'crypto'
6+
7+
Object.defineProperty(global, 'crypto', {
8+
value: {
9+
getRandomValues: (arr: any) => crypto.randomBytes(arr.length),
10+
},
11+
})

0 commit comments

Comments
 (0)