Closed jcrang closed 3 weeks ago
Hi, @jcrang. Thanks for proposing this.
Is BroadcastChannel
truly undefined in JSDOM?
We can also take it from the global scope, it's defined there.
Thanks for the quick resolution @kettanaito.
To answer your question (hopefully?) we were getting the same errors as for other properties that are fixed in jest-fixed-jsdom
. The full error from our tests runs is:
● Test suite failed to run
ReferenceError: BroadcastChannel is not defined
// location in our code
at Object.<anonymous> (node_modules/msw/src/core/ws.ts:20:26)
at Object.<anonymous> (node_modules/msw/src/core/index.ts:13:40)
at Object.require (Views/Shared/utils/msw/index.ts:3:1) // Our code
at Object.require (Views/Shared/utils/msw/jest.ts:2:1) // Our code
at Object.<anonymous> // Our code
This has been released in v0.0.7!
Make sure to always update to the latest version (npm i jest-fixed-jsdom@latest
) to get the newest features and bug fixes.
Predictable release automation by @ossjs/release.
As of MSW 2.6.0,
BroadcastChannel
is required to be defined.Have polyfilled this myself with: