简体   繁体   English

Angular2主题单元测试

[英]Angular2 subject unit testing

How can I unit test (jasmine) subject.next() in angular2 service? 如何在angular2服务中对(茉莉花)subject.next()进行单元测试?

I am using subject to pass data to its observer written in component after my http call is done. 我完成http调用后,正在使用subject将数据传递给用组件编写的观察者。

I made spy object for next() and expected that next has been called. 我做了一个next()的间谍对象,并期望next已被调用。 It solved. 解决了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM