apexcharts / ng-apexcharts

ng-apexcharts is an implementation of apexcharts for angular. It comes with one simple component that enables you to use apexcharts in an angular project.
MIT License
310 stars 78 forks source link

Cannot find module 'ng-apexcharts' in spec.ts #233

Open Shadowblash opened 1 year ago

Shadowblash commented 1 year ago

Hi,

I'm currently trying to do unit tests on my Angular app using ng-apexcharts lib. Unfortunately, when I run my tests with Jest, I get this error:

Cannot find module 'ng-apexcharts' from 'src/app/modules/gridComparisons/display-comparison/display-comparison.component.spec.ts'

image

The library is well imported in my module and I can use the charts in my component. But the unit tests are not valid.

I'm currently using : "apexcharts": "3.29.0" "ng-apexcharts": "^1.7.1" Angular 12

I tried everything, re-install node_modules, import the script "node_modules/apexcharts/dist/apexcharts.min.js" in the angular.json file

Why does it work in my components and not in the unit tests? Is there an incompatibility with Jest? Thanks.