Chartjs-Testing Chart.js Plugin with React and Jest/Enzyme

0👍

Can you post the output of your test? Is it checking the actual node_module plugin for chart.js or is it the one that you’ve built?

If it’s trying to test against node_modules then it’s best to ignore that entire directory from your tests via your package.json like so.

  "jest": {
    "testPathIgnorePatterns": [
      "./node_modules/"
    ],
    "collectCoverageFrom": [
      "!/node_modules/*"
    ]
  }

Leave a comment