[jest] fix module mapper regex (#133311) (#133324)

(cherry picked from commit deb0598c2d)

Co-authored-by: Spencer <spencer@elastic.co>
This commit is contained in:
Kibana Machine 2022-06-01 12:39:55 -05:00 committed by GitHub
parent 9c6b9c5e1e
commit 57a1624f2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,7 @@ module.exports = {
'^(!!)?file-loader!': '<rootDir>/node_modules/@kbn/test/target_node/jest/mocks/file_mock.js',
...Object.fromEntries(
Array.from(pkgMap.entries()).map(([pkgId, repoRelativeDir]) => [
`^${pkgId}(/?.*)$`,
`^${pkgId}(/.*)?$`,
`<rootDir>/${repoRelativeDir}$1`,
])
),