Accepted answer

Unless I am missing something, I think this is pretty straightforward. You don't want to unit test someone else's code (in this case chart.js), so you might simply want to determine if chart.chart.update() is being called within chart service. I would set up a spy for this, something like the following:

it('updateChartWith() should call chart.update()', () => {
    chartSpy = jasmine.createSpyObj({ update: null });
    chartMock = {chart: chartSpy};

Related Query

More Query from same tag