We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb1c5c9 commit 9da007fCopy full SHA for 9da007f
docs/articles/testing.md
@@ -202,3 +202,20 @@ describe("myFunction", () => {
202
});
203
204
```
205
+
206
+### Polyfills
207
208
+If you are running unit tests in a Node.js environment, you may need to polyfill
209
+some globals. Zuplo itself does not run on Node.js, but because Zuplo is built
210
+on standard API, testing in Node.js is possible.
211
212
+If you are running on Node.js 20 or later, you can use the `webcrypto` module to
213
+polyfill the `crypto` global. You must register this polyfill before any Zuplo
214
+code runs.
215
216
+```js
217
+import { webcrypto } from "node:crypto";
218
+if (typeof crypto === "undefined") {
219
+ globalThis.crypto = webcrypto;
220
+}
221
+```
0 commit comments