2017-09-26 60 views
0

當我運行一些業力測試,並創建一個像tutorial 1st.spec.ts,它沒有任何問題。但是當我嘗試創建一個xxxx.component.spec.ts時,沒有一個測試運行,即使1st.spec.ts也不會運行。karma測試角度不能在組件中運作

編輯: 我調試系統地查明問題:雖然不是最好的方式

beforeEach(() => { 
    TestBed.configureTestingModule({ 
     declarations: [ LoginComponent ], // declare the test component 
    }); 


    }); 
+0

哪個教程教程?你能更精確地回答你的問題嗎? –

+0

https://angular.io/guide/testing –

+0

如果您從https://angular.io/generated/live-examples/testing/1st-specs.eplnkr.html中檢查index.html。他們在配置中硬編碼了spec文件。這就是爲什麼你無法重命名文件並進行測試。 –

回答