mirror of
https://github.com/element-hq/element-call.git
synced 2026-06-04 08:11:40 +00:00
Switch from global to globalThis to fix import issues
This commit is contained in:
@@ -63,7 +63,10 @@ vi.mock("react-use-measure", () => ({
|
||||
|
||||
vi.hoisted(
|
||||
() =>
|
||||
(global.ImageData = class MockImageData {
|
||||
// Use globalThis rather than global because vite-plugin-node-polyfills seems
|
||||
// to rewrite global into an import which then interferes with vitest's hoisting
|
||||
// which runs before imports.
|
||||
(globalThis.ImageData = class MockImageData {
|
||||
public data: number[] = [];
|
||||
} as unknown as typeof ImageData),
|
||||
);
|
||||
|
||||
@@ -57,7 +57,10 @@ import { initializeWidget } from "../widget";
|
||||
initializeWidget();
|
||||
vi.hoisted(
|
||||
() =>
|
||||
(global.ImageData = class MockImageData {
|
||||
// Use globalThis rather than global because vite-plugin-node-polyfills seems
|
||||
// to rewrite global into an import which then interferes with vitest's hoisting
|
||||
// which runs before imports.
|
||||
(globalThis.ImageData = class MockImageData {
|
||||
public data: number[] = [];
|
||||
} as unknown as typeof ImageData),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user