From 37d907f2d6150eb90263f8297c3b02c1e169764e Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Tue, 21 May 2019 18:57:11 +0200 Subject: [PATCH] allow x-pack plugins to import core service mocks (#36771) using relative imports from x-pack to kibana core doesn't work atm. although we cannot use absolute imports, because jest cannot match them internally. --- x-pack/dev-tools/jest/create_jest_config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/dev-tools/jest/create_jest_config.js b/x-pack/dev-tools/jest/create_jest_config.js index ad5b2fde1acf..f8b94987dbff 100644 --- a/x-pack/dev-tools/jest/create_jest_config.js +++ b/x-pack/dev-tools/jest/create_jest_config.js @@ -22,6 +22,7 @@ export function createJestConfig({ ], moduleNameMapper: { '^ui/(.*)': `${kibanaDirectory}/src/legacy/ui/public/$1`, + '^src/core/(.*)': `${kibanaDirectory}/src/core/$1`, '^plugins/xpack_main/(.*);': `${xPackKibanaDirectory}/plugins/xpack_main/public/$1`, '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `${kibanaDirectory}/src/dev/jest/mocks/file_mock.js`,