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.
This commit is contained in:
Mikhail Shustov 2019-05-21 18:57:11 +02:00 committed by GitHub
parent 7ca9b46e9c
commit 37d907f2d6
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`,