1
我试图用dart测试异步代码。如何用angulardart测试异步代码
我的逻辑是:
- 我的服务删除节点的延迟之后。
- 在我的测试中,我执行服务,他们等待一段时间的延迟测试节点是否被移除。
我做到这一点香草镖,但角度我得到异常:
Test failed: Caught [Timer created from sync function.]
然后我用我的测试中异步并得到如下错误:
Test failed: Caught [2 active timer(s) are still in the queue.]
创建这里的测试回购:https://github.com/giovannicandido/angulardart-async-test
谢谢。我认为应该存在一个特定于测试的文档。用角度测试是使开发人员头很热的原因:-)。我通常会去源代码,但它不是微不足道的。 – 2014-10-30 21:47:54