2016-10-26 68 views
0

我創建了一個測試環境,我使用Karma JS運行我的QUnit測試和Karma的JUnit插件,將測試結果導出爲Jenkins的xml格式。 所有效果都很好,在Jenkins中查看測試是可以的,但是當我在當地運行Karma時會發生什麼情況,並且希望看到沒有Jenkins的測試結果? 是的,我可以在瀏覽器中查看xml報告,即使使用XSL查看器,但我希望看到它們的格式更好。用Karma JS更好地查找QUnit測試報告

Karma的任何好記者與QUnit一起工作,也許以html格式查看結果?

回答

0

不知道當我問這個問題時我在想什麼,但Karma在運行時創建瀏覽器窗口,並在瀏覽器內部加載包括必需html容器在內的測試。在karma.conf.js中使用這些設置,我可以看到單獨運行時打印出來的QUnit測試。

// Continuous Integration mode 
// if true, Karma captures browsers, runs the tests and exits 
singleRun: false, 

// Concurrency level 
// how many browser should be started simultaneous 
concurrency: Infinity, 

// client configuration 
client: { 
    clearContext: false, 
    qunit: { 
    showUI: true, 
    testTimeout: 5000, 
    filter: 'getColor(colorType, hashColor)'// name of the QUnit module to show logs on only. 
    } 
} 

karmajs and qunit run locally

我想這將足以在當地做我的測試。 不好的一點是,我必須關閉Karma才能加載不同的配置,例如針對特定功能的過濾器測試。