From c8b78d04e28d0c7bf89b49a057b240895fa7de50 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 2 May 2022 11:51:17 +0200 Subject: [PATCH] Fixed jest config to transform react-chartjs-2 lib --- jest.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 65f89256..4c3f3792 100644 --- a/jest.config.js +++ b/jest.config.js @@ -26,13 +26,14 @@ module.exports = { }, transformIgnorePatterns: [ '/.stryker-tmp', - '/node_modules\\/(?!react-leaflet)\.(js|jsx|ts|tsx)$', + 'node_modules\/(?!(\@react-leaflet|react-leaflet|leaflet|react-chartjs-2)\/)', '^.+\\.module\\.scss$', ], moduleNameMapper: { '^.+\\.module\\.scss$': 'identity-obj-proxy', // Reactstrap module resolution does not work in jest for some reason. Manually mapping it solves the problem 'reactstrap': '/node_modules/reactstrap/dist/reactstrap.umd.js', + 'react-chartjs-2': '/node_modules/react-chartjs-2/dist/index.js', }, moduleFileExtensions: ['js', 'ts', 'tsx', 'json'], };