使用Jasmine测试Ember.js应用程序

16

有没有关于测试ember.js应用程序的资源、示例或教程?

你如何测试视图?

似乎没有关于这方面的详细示例/信息。

3个回答

16

2
你也可以使用Ember本身的测试功能,如此文章所述。
基本上它所做的是通过设置Ember.testing = true来禁用Ember runloop。这样你就不必检查你的异步代码是否完成。你只需要将其包装在自己的runloop中即可。
// Creating an application normally happens async,
// which is why we have to wrap it in Ember.run
Ember.run(function() {
  App = Ember.Application.create();
});

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接