diff --git a/jest.config.js b/jest.config.js index ee63281e2c38..62b87d9841f5 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,20 +1,3 @@ -// These packages under the @babel namespace aren't in this monorepo. -const externalBabelPackages = [ - "plugin-syntax-async-generators", - "plugin-syntax-bigint", - "plugin-syntax-dynamic-import", - "plugin-syntax-json-strings", - "plugin-syntax-nullish-coalescing-operator", - "plugin-syntax-object-rest-spread", - "plugin-syntax-optional-catch-binding", - "plugin-syntax-optional-chaining", - "plugin-syntax-export-namespace-from", -]; - -// prettier-ignore -const monorepoPackagePattern = - `^@babel/(?!eslint-)(?!${externalBabelPackages.join("|")})([a-zA-Z0-9_-]+)$`; - module.exports = { collectCoverageFrom: [ "packages/*/src/**/*.mjs", @@ -60,8 +43,8 @@ module.exports = { "/test/__data__/", "/build/", ], - moduleNameMapper: { - [monorepoPackagePattern]: "/packages/babel-$1/", - "^@babel/eslint-([a-zA-Z0-9_-]+)$": "/eslint/babel-eslint-$1/", - }, + // We don't need module name mappers here as depedencies of workspace + // package should be declared explicitly in the package.json + // Yarn will generate correct file links so that Jest can resolve correctly + moduleNameMappers: null, };