Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/442.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Ember.js和Ember.testing=true_Javascript_Ember.js_Ember Data - Fatal编程技术网

Javascript Ember.js和Ember.testing=true

Javascript Ember.js和Ember.testing=true,javascript,ember.js,ember-data,Javascript,Ember.js,Ember Data,我正在尝试在Ember.js中使用Ember.testing=true标志来禁用自动运行循环,等等 我有这个密码 Ember.testing = true; Ember.run(function() { App = Ember.Application.create(); }); App.Router.map(function() { this.route("home", { path: "/" }); }); Ember.run(function() { App.init

我正在尝试在Ember.js中使用Ember.testing=true标志来禁用自动运行循环,等等

我有这个密码

Ember.testing = true;

Ember.run(function() {  
  App = Ember.Application.create();
});

App.Router.map(function() {
  this.route("home", { path: "/" });
});


Ember.run(function() {
  App.initialize();
});
我已经得到了这个错误

Uncaught Error: assertion failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run 
我知道您需要在一个Ember.run中运行异步代码,根据我能找到的任何示例,我都有这个程序

有人能告诉我我做错了什么,甚至让jsin示例不显示这个错误吗

请看这里的jsbin

更新:

我正在使用Konacha运行测试,当我使用最新的RC1时,在Em.run中包装Ember.Application.create()和App.initialize()时出现错误。当我删除这些时,我没有得到任何错误。这在最新版本中正确吗

谢谢
里克

余烬。测试自RC1以来已更改,如果您想使用它,您应该使用master


将你的
App.Router.map
调用放入一个run块。@Waleed Khan谢谢,但当我在jsbin中这样做时,我仍然会收到相同的错误。你不觉得吗?