allow x-pack plugins to import core service mocks (#36771) (#36799)

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.
This commit is contained in:
Mikhail Shustov 2019-05-21 20:40:14 +02:00 committed by GitHub
parent d151e1a519
commit 096c3ffc81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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`,