For example, when testing container component we might import lots of children components, but we didn't actually testing those children components. So we don't need to provide all those stuff:

    TestBed.configureTestingModule({
imports: [
ReactiveFormsModule
],
declarations: [
StockBranchComponent,
StockCounterComponent,
StockProductsComponent,
StockSelectorComponent,
StockInventoryComponent
],
providers: [
{provide: StockInventoryService, useClass: MockStockInventoryService }
]
})

One way to sovle this is by providing '

NO_ERRORS_SCHEMA

'

import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';

    TestBed.configureTestingModule({
imports: [
ReactiveFormsModule
],
declarations: [
StockInventoryComponent
],
schemas: [NO_ERRORS_SCHEMA],
providers: [
{ provide: StockInventoryService, useClass: MockStockInventoryService }
]
});

最新文章

  1. 关于VS2010无法编译问题
  2. web接口开发与测试
  3. JavaWeb chapter9 JSP基础
  4. JavaScript:变量对象(Variable Object)
  5. 菜鸟学习Spring——60s利用JoinPoint获取参数的值和方法名称
  6. Struts2 cookie的存取
  7. Oracle的三种高可用集群方案
  8. 获取鼠标点击相对于Canva位置的2种方法
  9. 【转载】matlab如何判断一个点是否在多面体内
  10. formidable 表单文件和数据提交
  11. JSON序列化类
  12. Open Source BI Platform List
  13. oracle使用数据泵进行数据的导入导出
  14. Spring+SpringMVC+Mybatis框架整合流程
  15. 从Windows到linux小记
  16. https连接器
  17. 常见注入手法第四讲,SetWindowsHookEx全局钩子注入.以及注入QQ32位实战.
  18. blfs(systemd版本)学习笔记-编译安装openssh软件包
  19. 多点触控 TouchAction
  20. Java中的继承抽象类和接口

热门文章

  1. gdal读写图像分块处理
  2. apache 使用 mod_fcgid.so模块时 配置指令
  3. 74LS153 选择器 【数字电路】
  4. shape- 设置虚线
  5. 1.5 Upgrading From Previous Versions官网剖析(博主推荐)
  6. Android 内存监测工具
  7. sql 高性能存储过程分页
  8. 【MySQL集群】——Java程序连接MySQL集群
  9. bitmap2drawable-两者的转化实现
  10. 让ie6 7 8 9支持原生html5 websocket