mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-21 19:09:20 +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(
|
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[] = [];
|
public data: number[] = [];
|
||||||
} as unknown as typeof ImageData),
|
} as unknown as typeof ImageData),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -57,7 +57,10 @@ import { initializeWidget } from "../widget";
|
|||||||
initializeWidget();
|
initializeWidget();
|
||||||
vi.hoisted(
|
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[] = [];
|
public data: number[] = [];
|
||||||
} as unknown as typeof ImageData),
|
} as unknown as typeof ImageData),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user