diff --git a/config/jest.config.js b/config/jest.config.js index 09ad0f09..b3b498b9 100644 --- a/config/jest.config.js +++ b/config/jest.config.js @@ -5,4 +5,14 @@ module.exports = { collectCoverage: Boolean(process.env.COVERAGE), collectCoverageFrom: ['/src/**/*.ts?(x)'], coveragePathIgnorePatterns: ['generated'], + /** + * Since we use a lot of denepencies as ES moules, we need configure + * jest to transform the files in node_modules which export as + * ES modules. + * The list can be very long if we enumerate dependencies as a whitelist, + * so we use a blacklist to ignore certain dependencies that should + * not be transformed. + * This may cause performance issue. + */ + transformIgnorePatterns: [`/node_modules/(jest|@testing-library)`], };