2014-10-02 31 views
1

這是asked before,但我不認爲它是相關的,因爲我的問題是錯誤,應該已經在這裏修復:https://github.com/rwjblue/ember-qunit/pull/85Ember qunit:Assertion Failed:您不能在Ember.Application中多次使用相同的根元素(#ember-testing)

但我仍然得到這個錯誤。

代碼:

import Ember from "ember"; 
import { test, moduleForComponent } from 'ember-qunit'; 
import startApp from '../../helpers/start-app'; 
var App; 

moduleForComponent('navigation-sidebar', 'NavigationSidebarComponent', { 
    setup: function(){ 
     App = startApp(); 
    }, 

    teardown: function(){ 
     Ember.run(App, 'destroy'); 
    } 
}); 

test('it opens sub menus on click', function() { 
    expect(3); 
    visit('/documents').then(function() { 
     ok(find('.parent ul').length, 'Page has submenu.'); 
     equal(find('.parent ul').is(':visible'), false); 
     click('.parent a'); 
    }); 


    andThen(function() { 
     equal(find('.parent ul').is(':visible'), true); 
    }); 
}); 

我嘗試過各種事情像復位拆卸,包裝破壞燼運行等

我在做什麼錯?

獎勵問題:我試過bower update ember-qunit,bower update ember-qunit --force,刪除了ember-qunit文件夾並運行bower install [email protected]:rwjblue/ember-qunit.git - 並且總是以未打補丁的版本結束。最後,我下載了一個zip文件並將其直接推入目錄。爲什麼這不起作用?

+0

你有什麼ember-cli版本? – lulezi 2014-10-03 10:44:54

+0

0.0.46,第一次出現錯誤時發生0.0.44 – shredding 2014-10-03 15:18:34

+0

您可以發佈您的「tests/app/index.html」的內容嗎? – lulezi 2014-10-03 18:45:27

回答

2

最後解決它:

  • moduleForComponent是單元測試而已,只是使用module集成測試
  • import { test } from 'ember-qunit'打破了測試,只是將其刪除。
相關問題