From 1b52311f2e02155de34539f06e7c0da524eac39c Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 2 Jun 2026 09:25:52 +0100 Subject: [PATCH] Fix jest tests (#33688) As of https://github.com/element-hq/element-web/pull/33573 (some?) jest tests fail with "SyntaxError: Cannot use import statement outside a module" when importing js-sdk. It removes js-sdk from moduleNameMapper in jest config although I'm not sure why. This puts it back so js-sdk resolves to the copy linked by our pnpm link script, which also makes get transformed. --- apps/web/jest.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/jest.config.ts b/apps/web/jest.config.ts index 75f72bfd07..4e19bbf0f7 100644 --- a/apps/web/jest.config.ts +++ b/apps/web/jest.config.ts @@ -35,6 +35,7 @@ const config: Config = { "\\.(gif|png|ttf|woff2)$": "/__mocks__/imageMock.js", "\\.svg$": "/__mocks__/svg.js", "\\$webapp/i18n/languages.json": "/__mocks__/languages.json", + "^matrix-js-sdk(.*)$": "/../../node_modules/matrix-js-sdk$1", "^react$": "/node_modules/react", "^react-dom$": "/node_modules/react-dom", "decoderWorker\\.min\\.js": "/__mocks__/empty.js",