title: ReferenceError: ResizeObserver is not defined
body: <p>I am writing tests using Jest for component which used chart.js to create a line chart. I am getting below error when I am running the tests.</p>
  <blockquote>
  <p>ReferenceError: ResizeObserver is not defined</p>
  <pre><code>  290 |   }
    291 |   ngAfterViewInit() {
  &gt; 292 |     this.chart = new Chart(this.chartRef.nativeElement, this.chartConfig);
        |                  ^
    293 |   }
    294 |
    295 |   ngOnInit() {
  
    at createResizeObserver (../../../node_modules/chart.js/dist/chart.js:2428:20)
    at DomPlatform.addEventListener (../../../node_modules/chart.js/dist/chart.js:2502:21)
    at _add (../../../node_modules/chart.js/dist/chart.js:7051:16)
    at attached (../../../node_modules/chart.js/dist/chart.js:7070:7)
    at Chart.bindResponsiveEvents (../../../node_modules/chart.js/dist/chart.js:7079:7)
    at Chart.bindEvents (../../../node_modules/chart.js/dist/chart.js:7023:12)
    at Chart._initialize (../../../node_modules/chart.js/dist/chart.js:6547:8)
    at new Chart (../../../node_modules/chart.js/dist/chart.js:6512:8)
  </code></pre>
  </blockquote>
  <p>ResizeObserver is being used internally by the chart.js and i am not using explicitly anywhere. Does any one have a solution for this?</p>