fix: LocalStorage is empty object on node@25 which breaks tests (#11240)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
+7
-3
@@ -8,7 +8,13 @@ import { vi } from "vitest";
|
||||
import polyfill from "./packages/excalidraw/polyfill";
|
||||
import { mockThrottleRAF } from "./packages/excalidraw/tests/helpers/mocks";
|
||||
import { yellow } from "./packages/excalidraw/tests/helpers/colorize";
|
||||
import { testPolyfills } from "./packages/excalidraw/tests/helpers/polyfills";
|
||||
import {
|
||||
PolyfillLocalStorage,
|
||||
testPolyfills,
|
||||
} from "./packages/excalidraw/tests/helpers/polyfills";
|
||||
|
||||
Object.assign(globalThis, testPolyfills);
|
||||
PolyfillLocalStorage();
|
||||
|
||||
vi.mock("@excalidraw/common", async (importOriginal) => {
|
||||
const module = await importOriginal<typeof import("@excalidraw/common")>();
|
||||
@@ -22,8 +28,6 @@ vi.mock("@excalidraw/common", async (importOriginal) => {
|
||||
// mock for pep.js not working with setPointerCapture()
|
||||
HTMLElement.prototype.setPointerCapture = vi.fn();
|
||||
|
||||
Object.assign(globalThis, testPolyfills);
|
||||
|
||||
require("fake-indexeddb/auto");
|
||||
|
||||
polyfill();
|
||||
|
||||
Reference in New Issue
Block a user