diff --git a/jest.config.ts b/jest.config.ts index 818a164ddd..d7f00f194e 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -21,9 +21,9 @@ import type { Config } from "jest"; const config: Config = { testEnvironment: "jsdom", testMatch: ["/test/**/*-test.[jt]s?(x)"], - globalSetup: "/test/globalSetup.js", + globalSetup: "/test/globalSetup.ts", setupFiles: ["jest-canvas-mock"], - setupFilesAfterEnv: ["/test/setupTests.js"], + setupFilesAfterEnv: ["/test/setupTests.ts"], moduleNameMapper: { "\\.(gif|png|ttf|woff2)$": "/__mocks__/imageMock.js", "\\.svg$": "/__mocks__/svg.js", diff --git a/test/components/structures/RoomView-test.tsx b/test/components/structures/RoomView-test.tsx index 8a9e385e8b..3d3fab4482 100644 --- a/test/components/structures/RoomView-test.tsx +++ b/test/components/structures/RoomView-test.tsx @@ -67,11 +67,6 @@ import { WidgetType } from "../../../src/widgets/WidgetType"; import WidgetStore from "../../../src/stores/WidgetStore"; import { ViewRoomErrorPayload } from "../../../src/dispatcher/payloads/ViewRoomErrorPayload"; -// Fake random strings to give a predictable snapshot for IDs -jest.mock("matrix-js-sdk/src/randomstring", () => ({ - randomString: () => "abdefghi", -})); - const RoomView = wrapInMatrixClientContext(_RoomView); describe("RoomView", () => { diff --git a/test/components/structures/SpaceHierarchy-test.tsx b/test/components/structures/SpaceHierarchy-test.tsx index 685fbc7d0d..5e414f5111 100644 --- a/test/components/structures/SpaceHierarchy-test.tsx +++ b/test/components/structures/SpaceHierarchy-test.tsx @@ -30,11 +30,6 @@ import MatrixClientContext from "../../../src/contexts/MatrixClientContext"; import DMRoomMap from "../../../src/utils/DMRoomMap"; import SettingsStore from "../../../src/settings/SettingsStore"; -// Fake random strings to give a predictable snapshot for checkbox IDs -jest.mock("matrix-js-sdk/src/randomstring", () => ({ - randomString: () => "abdefghi", -})); - describe("SpaceHierarchy", () => { describe("showRoom", () => { let client: MatrixClient; diff --git a/test/components/structures/__snapshots__/RoomView-test.tsx.snap b/test/components/structures/__snapshots__/RoomView-test.tsx.snap index c0a2989f96..3a65706ef0 100644 --- a/test/components/structures/__snapshots__/RoomView-test.tsx.snap +++ b/test/components/structures/__snapshots__/RoomView-test.tsx.snap @@ -54,7 +54,7 @@ exports[`RoomView for a local room in state CREATING should match the snapshot 1
renders 1`] = ` class="mx_Checkbox mx_Checkbox_hasKind mx_Checkbox_kind_solid" >