【发布时间】:2020-04-11 21:08:00
【问题描述】:
我在 Angular 7+ 中使用 Highcharts API。
假设在某个组件中,我的图表类型是'area',而我的tooltip代码如下:
tooltip:{
shared : true,
outside : true,
useHTML : true,
formatter(){
let str = `<table>`;
this.points.forEach((point)=>{
str = str.concat(
`<tr>
<td style="color: ${point.series.color};font-size: 0.9em"></td>
</tr>
`
);
str = str.concat('</table>');
return str;
})
}
}
现在在对该组件进行单元测试时,代码覆盖率不是 100%,并且在 index.html 文件中显示工具提示部分未被覆盖。如何检查是否相同?
【问题讨论】:
标签: angular unit-testing highcharts