Skip to content

Commit

Permalink
Fix jest config
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jan 12, 2020
1 parent b50036e commit eec7b63
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion jest.config.js
@@ -1,3 +1,19 @@
// These packages undet 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",
];

// prettier-ignore
const monorepoPackagePattern =
`^@babel/(?!eslint-)(?!${externalBabelPackages.join("|")})([a-zA-Z0-9_-]+)$`;

module.exports = {
collectCoverageFrom: [
"packages/*/src/**/*.mjs",
Expand Down Expand Up @@ -46,7 +62,7 @@ module.exports = {
"<rootDir>/build/",
],
moduleNameMapper: {
"^@babel/(?!eslint-)([a-zA-Z0-9_-]+)$": "<rootDir>/packages/babel-$1/",
[monorepoPackagePattern]: "<rootDir>/packages/babel-$1/",
"^@babel/eslint-([a-zA-Z0-9_-]+)$": "<rootDir>/eslint/babel-eslint-$1/",
},
};

0 comments on commit eec7b63

Please sign in to comment.