The method takes as arguments the name of the Service to be mocked, and the second argument is an array of all the methods inside that class that needs to be mocked.
You should pass to your spy object the original service name and methods that are used by your code.
发布评论
评论(1)
createSpyObj
具有以下描述文档:
茉莉花 )
该方法将要模拟的服务名称作为参数,第二个参数是需要模拟该类中所有方法的数组。
您应该将代码使用的原始服务名称和方法传递给间谍对象。
createSpyObj
has the following description from theJasmine documentation:
createSpyObj(baseName, methodNames, propertyNames)
The method takes as arguments the name of the Service to be mocked, and the second argument is an array of all the methods inside that class that needs to be mocked.
You should pass to your spy object the original service name and methods that are used by your code.