Angular 使用VMware Clarity模块进行角度2单元测试

Angular 使用VMware Clarity模块进行角度2单元测试,angular,unit-testing,vmware-clarity,Angular,Unit Testing,Vmware Clarity,我正在为angular 2项目进行POC,该项目使用VMware的Clarity组件。当我运行测试运行程序时,会出现以下错误: 'clr-main-container' is not a known element: 1. If 'clr-main-container' is an Angular component, then verify that it is part of this module. 2. If 'clr-main-container' is a Web Component

我正在为angular 2项目进行POC,该项目使用VMware的Clarity组件。当我运行测试运行程序时,会出现以下错误:

'clr-main-container' is not a known element:
1. If 'clr-main-container' is an Angular component, then verify that it is part of this module.
2. If 'clr-main-container' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<clr-main-container>
“clr-main-container”不是已知元素:
1.如果“clr主容器”是角度组件,则验证它是否是此模块的一部分。
2.如果“clr main container”是Web组件,则将“CUSTOM_ELEMENTS_SCHEMA”添加到此组件的“@NgModule.schemas”以抑制此消息。(“[错误->]
我是angular 2的新手,在谷歌上找不到任何东西。

嗨, 您可能在测试中缺少测试台配置。类似于:

import{async,ComponentFixture,TestBed}来自“@angular/core/testing”;
从'clarity angular'导入{ClarityModule};
描述(“…”,函数(){
在每个之前(()=>{
TestBed.configureTestingModule({
导入:[ClarityModule.forRoot()],
声明:[YourTestComponent]
});
});

})
Hi@agillette。看起来您尚未注册
ClarityModule
。需要更多详细信息来了解完整问题。测试运行者是什么?您正在使用Clarity种子项目吗?我建议您浏览Clarity get started页面:并使用他们的种子应用程序。