I am using CanvasJS to display charts in an Angular app. The charts display properly when running my app, so I know CanvasJS is a part of the project and is working. However, Jest can’t find CanvasJS when unit testing, here’s the error:
import Charts from ‘../core/charts’;
^^^^^^
SyntaxError: Unexpected identifier
1 | import { Component, OnInit } from ‘@angular/core’;
> 2 | import * as CanvasJS from ‘canvasjs’;
| ^
3 |
Any idea what a solution could be for this?