Skip to content

Commit

Permalink
test: remove moduleNameMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Sep 29, 2020
1 parent 849b5c4 commit e17919b
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions 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",
Expand Down Expand Up @@ -60,8 +43,8 @@ module.exports = {
"/test/__data__/",
"<rootDir>/build/",
],
moduleNameMapper: {
[monorepoPackagePattern]: "<rootDir>/packages/babel-$1/",
"^@babel/eslint-([a-zA-Z0-9_-]+)$": "<rootDir>/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,
};

0 comments on commit e17919b

Please sign in to comment.