From e7045db8562847e3af5a9c85a7fbdb52f4351160 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Wed, 28 Aug 2024 15:54:19 +0200 Subject: [PATCH] Fix React Canary and Experimental tests --- tests/setup-env.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/setup-env.js b/tests/setup-env.js index c9b976f5..1a4401de 100644 --- a/tests/setup-env.js +++ b/tests/setup-env.js @@ -1,5 +1,9 @@ import '@testing-library/jest-dom/extend-expect' import './failOnUnexpectedConsoleCalls' import {TextEncoder} from 'util' +import {MessageChannel} from 'worker_threads' global.TextEncoder = TextEncoder +// TODO: Revisit once https://github.com/jsdom/jsdom/issues/2448 is resolved +// This isn't perfect but good enough. +global.MessageChannel = MessageChannel