Skip to content

Commit 99e50a1

Browse files
committed
added e2e setup file to include webcrypto for node versions 18 and lower where global crypto is not available
1 parent ba6134e commit 99e50a1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

test/jest-e2e.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
},
99
"moduleNameMapper": {
1010
"^src/(.*)$": "<rootDir>/../src/$1"
11-
}
11+
},
12+
"setupFiles": ["<rootDir>/jest-setup.js"]
1213
}

test/jest-setup.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { webcrypto } from "node:crypto";
2+
3+
if (!global.crypto) {
4+
global.crypto = webcrypto;
5+
}

0 commit comments

Comments
 (0)