I am making a chart.js application in which functionality is implemented and now in the need to implement unit test for the same.
Things I have tried,
chart.tsx:
<div>
<MyChart chartData={data} />
</div>
chart.test.tsx:
import React from "react";
jest.mock("chartjs", () => ({
Line: () => null
}));
I have made the above code as unit test for chart.js integration. But unable to run the test for the same.
Working Example:
Could someone please help me in making the unit test for chart.js running efficiently?