我目前正在使用Aurelia-Validation插件来做客户端验证。因为验证对象必须被注入到调用类的构造函数中,所以我对这个类的所有jasmine测试现在都失败了(因为没有传入验证对象)。我尝试创建一个模拟验证对象已经有一段时间了,甚至是一个真正的对象,但我似乎不能正确地创建。我得到的最接近的是: cache = new Cac
示例项目包含两个组件( TestComponent和Test1Component)、一个服务(TestService)和一个TestComponent将扩展的类(Base)。有一个用例,我需要在不使用构造函数的情况下获得服务实例,我正在使用下面的代码,它工作得很好。AppModule.injector.get(TestService); // with this i can get test service succesfully}
当我试图为TestComponent编写测试用例时fixture.detect
如果我在角tsconfig.json项目的4+文件中设置了这个值:...and导入它以用于单元测试中:
import { Spy } from "karma-jasmine'C:/test-project/node_modules/karma-jasmine/lib/index.js' implicitly has an 'any' typ