From 04971bb229f6a61aff50f268c63d3f03516b1e2f Mon Sep 17 00:00:00 2001 From: Aaron Isakov <61562774+Grieze@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:13:51 -0600 Subject: [PATCH] Update jest-missing-globals.mdx Updated the jest-missing-globals doc to fix the common issue related to ReadableStream not being defined as of Jest V29. --- src/content/docs/shared/jest-missing-globals.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/content/docs/shared/jest-missing-globals.mdx b/src/content/docs/shared/jest-missing-globals.mdx index b8000ddc..6e3a57af 100644 --- a/src/content/docs/shared/jest-missing-globals.mdx +++ b/src/content/docs/shared/jest-missing-globals.mdx @@ -25,10 +25,12 @@ Create a `jest.polyfills.js` file next to your `jest.config.js` with the followi */ const { TextDecoder, TextEncoder } = require('node:util') +const { ReadableStream } = require('stream/web') Object.defineProperties(globalThis, { TextDecoder: { value: TextDecoder }, TextEncoder: { value: TextEncoder }, + ReadableStream: { value: ReadableStream }, }) const { Blob, File } = require('node:buffer')