From efc824207b8e826e4ce2c9c71882d67285ddb0c6 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Fri, 10 May 2024 10:48:22 -0700 Subject: [PATCH] build(plugin-keychain-memory): fix local imports broken due to .js exts Found the solution and a long discussion about it here: https://github.com/kulshekhar/ts-jest/issues/1057 TLDR: The Jest resolver needs a little extra information/tweak to the config so that it can correctly handle the .js imports. Specifically this comment provided the solution which I made here: https://github.com/kulshekhar/ts-jest/issues/1057#issuecomment-1482644543 Fixes #3254 Signed-off-by: Peter Somogyvari --- jest.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jest.config.js b/jest.config.js index e9055853394..3be75ede5d9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,6 +3,9 @@ module.exports = { preset: "ts-jest", logHeapUsage: true, testEnvironment: "node", + moduleNameMapper: { + "^(\\.\\.?\\/.+)\\.jsx?$": "$1", + }, maxWorkers: 1, maxConcurrency: 1, setupFilesAfterEnv: ["jest-extended/all", "./jest.setup.console.logs.js"],