Ember.js App.reset()在ember qunit拆卸时失败

Ember.js App.reset()在ember qunit拆卸时失败,ember.js,ember-qunit,Ember.js,Ember Qunit,我的所有ember qunit测试都有类似的设置: moduleFor('route:marketplace-search', 'Marketplace Search route', { setup: function() { setFixtures(); }, teardown: function() { App.reset(); } }); 其中一个正在抛出错误: 未捕获类型错误:无法读取null的属性“length” 这可以追溯到我的marketplace

我的所有ember qunit测试都有类似的设置:

moduleFor('route:marketplace-search', 'Marketplace Search route', {
  setup: function() {
    setFixtures();
  },
  teardown: function() {
    App.reset();
  }
});
其中一个正在抛出错误:
未捕获类型错误:无法读取null的属性“length”

这可以追溯到我的
marketplace\u search\u spec.js
文件中的
App.reset()
行:

DEBUG: ------------------------------- ember.js?body=1:14069
DEBUG: Ember      : 1.7.0-beta.1+canary.3d81867a ember.js?body=1:14069
DEBUG: Ember Data : 1.0.0-beta.9+canary.45d196b2 ember.js?body=1:14069
DEBUG: Handlebars : 1.3.0 ember.js?body=1:14069
DEBUG: jQuery     : 1.10.2 ember.js?body=1:14069
DEBUG: ------------------------------- ember.js?body=1:14069
Uncaught TypeError: Cannot read property 'length' of null ember.js?body=1:26529
__exports__.default.ArrayProxy.extend._resetSubControllers ember.js?body=1:26529
__exports__.default.ArrayProxy.extend.willDestroy ember.js?body=1:26542
apply ember.js?body=1:17952
superWrapper ember.js?body=1:17538
DeferredActionQueues.invoke ember.js?body=1:637
DeferredActionQueues.flush ember.js?body=1:687
Backburner.end ember.js?body=1:150
Backburner.run ember.js?body=1:205
apply ember.js?body=1:17955
run ember.js?body=1:16601
handleReset ember.js?body=1:2701
Backburner.run ember.js?body=1:201
apply ember.js?body=1:17955
run ember.js?body=1:16601
apply ember.js?body=1:17955
run.join ember.js?body=1:16643
Namespace.extend.reset ember.js?body=1:2710
moduleFor.teardown marketplace_search_spec.js?body=1:6
_callbacks.teardown ember-qunit.js?body=1:175
Test.teardown teaspoon-qunit.js?body=1:226
(anonymous function) teaspoon-qunit.js?body=1:366
process teaspoon-qunit.js?body=1:1455
(anonymous function) teaspoon-qunit.js?body=1:481
你知道我为什么会失败吗

Failures:

  1) Marketplace Search route transitions to company.marketplace (1, 1, 2)
     Failure/Error: Teardown failed on transitions to company.marketplace: 'null' is not an object (evaluating 'subControllers.length')

Finished in 7.94400 seconds
127 examples, 1 failure

正如@AmielMartin所指出的,我的问题是由于没有在控制器
init
函数中调用
\u super
而引起的,我在
ArrayController
上重写了该函数

App.MarketplaceSearchController = Ember.ArrayController.extend({
  init: function() {
    this._super();
    // Do stuff here
  }
});

你能找到断开的那条线吗?ie
ember.js?body=1:26529
@AmielMartin您还可以提供您的ArrayController吗?你有没有可能在没有调用
\u super
的情况下定义了
init
?@AmielMartin就是这样。。太简单了!谢谢我仍然不清楚什么时候需要或不需要超级。@chriscaselas请看这里的注释-