【发布时间】:2021-05-21 06:18:43
【问题描述】:
this.service = () => { -- statements -- }
上面的语句要在angular中使用jasmine单元测试进行测试。 我能得到一些建议吗?
it("should service call",()=>{ // i want to call the arrow function here like component.service.? what to use in place of '?'. })
【问题讨论】:
-
component.service() -
不工作选项可用:调用、绑定、应用......
-
应该可以工作,请注意删除的点 =>
.。不是component.service.(),只是component.service() -
this.service.fun = () => {}现在我想打电话给乐趣 -
现在它通过错误
fun is not a function
标签: node.js angular typescript unit-testing jasmine