From e17919bf788dae2cf44881132ccfa23a66a9af1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 29 Sep 2020 14:59:38 -0400 Subject: [PATCH] test: remove moduleNameMapper --- jest.config.js | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/jest.config.js b/jest.config.js index ee63281e2c38..bd6807a82110 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 + moduleNameMapper: null, };