簡體   English   中英

Karma自定義測試頁面

[英]Karma custom test page

Karma有一個內置的context.html文件,可以加載測試頁面。 但它很糟糕。 我可以指定自定義測試頁嗎?

我問的原因是因為我想在瀏覽器上看到mocha漂亮的界面。 有沒有辦法用Karma插入?

Testem在瀏覽器上顯示測試框架的界面; 有沒有理由為什么Karma只顯示一個丑陋的空白頁?

@stackoverflow = are you happy now?yes:no
stackoverflow = happy now?ok:thanks

自發布以來,Karma添加了一個指定自定義HTML文件的選項。 該屬性稱為customContextFile

module.exports = {
  config.set({
        basePath: './',
        frameworks: ['jasmine'],
        reporters: ['dots'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        browserNoActivityTimeout: 100000,
        plugins: [
            'karma-chrome-launcher',
            'karma-jasmine'
        ],     
        customContextFile: 'specRunner.html',
        files: [
            {
                pattern: 'dist/tests/*.specs.js',
                served: true,
                watched: true
            }
        ]
    })
}

閱讀更多

拉請求 - https://github.com/karma-runner/karma/pull/1825

docs - http://karma-runner.github.io/1.0/config/configuration-file.html#

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM