2013-07-18 17 views
10

我有我與噶運行這個測試茉莉:在Karma-Runner中使用Karma-Jasmine提供程序時,將茉莉花測試標記爲跳過?

describe('When a logged in user chooses Rent and Payment PIN is enabled', function() { 
    beforeEach(function(){ 

    }); 

    afterEach(function() { 

    }); 

    it('should be presented with a dialog to enter the pin', function() { 
     //test to be skipped 
    }) 
})  

而且我希望看到報告說,該測試已跳過回來測試時需要測試的東西都將準備。

我該如何做到這一點?

+1

我有同樣的問題。跳過測試很容易(只需將它改爲「xit」),但是我沒有找到一種方法,當我運行業力時,測試在報告中被跳過。 –

+0

我發現[github上的問題](https://github.com/karma-runner/karma-jasmine/issues/3)。如果您仍然對此感興趣,請留下評論以吸引開發者的注意力 –

回答

6

您可以嘗試在規範中使用pending函數。根據文檔,待定規格不會運行,但名稱仍顯示在結果中。對於2.0,它也表示空方法體應該工作。嘗試:

it('should be presented with a dialog to enter the pin', function() { 
    pending(); 
}) 

it('should be presented with a dialog to enter the pin');