angular - 找出在 Karma 测试期间哪个 Angular 组件发出错误
问题描述
在运行我的 Karma 测试时,我收到很多错误(实际上是警告),如下所示:
ERROR: 'NG0304: 'fa-icon' is not a known element:
1. If 'fa-icon' is an Angular component, then verify that it is part of this module.
2. If 'fa-icon' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.'
现在,一旦您知道哪个组件抱怨未知元素,这很容易解决。问题是应用程序有几十个,而 Karma 的输出没有提供任何关于问题出在哪里的线索。
如何找出导致错误的组件,而不需要有选择地对每个组件运行测试?
解决方案
推荐阅读
- python - 如何使用键盘事件作为条件语句的一部分
- python - 名称“运行文件”未定义窗口中的错误
- python - 根据熊猫数据框的条件创建字典
- html-email - 如何为freemarker中的嵌套对象赋值
- utf-8 - 每个字节的第一位设置为 0 的文件
- autosar - AUTOSAR NetworkHandleType 值
- powershell - 查找不属于特定 GG 组成员的计算机
- android - 带有片段的底部导航和所选项目顶部的栏,如下图所示
- c# - IText - 计算 TagWorkers 中元素和文本的宽度
- c# - 合并两个 IQueryable 结果返回错误