【问题标题】:display karma tests on browser在浏览器上显示业力测试
【发布时间】:2015-02-21 04:22:55
【问题描述】:

我是 karma 单元测试角度的新手。我测试了 angular-socket-io 应用程序。这是我在控制台上运行 karma start 时看到的。

21:58 /tmp/angular-socket-io $ karma start
INFO [karma]: Karma v0.10.10 server started at http://localhost:9999/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 40.0.2214 (Mac OS X 10.8.3)]: Connected on socket AOee3c4IW51Z30jfShdU
Chrome 40.0.2214 (Mac OS X 10.8.3): Executed 18 of 18 SUCCESS (4.393 secs / 0.083 secs)
INFO [Chrome 40.0.2214 (Mac OS X 10.8.3)]: Connected on socket IMCGlDXZwhJJ8Y6YShdV
Chrome 40.0.2214 (Mac OS X 10.8.3): Executed 18 of 18 SUCCESS (0.159 secs / 0.09 secs)
Chrome 40.0.2214 (Mac OS X 10.8.3): Executed 18 of 18 SUCCESS (0.249 secs / 0.093 secs)
TOTAL: 36 SUCCESS

我想查看我的 Chrome 浏览器上列出的所有测试。这可能吗?

【问题讨论】:

    标签: angularjs unit-testing karma-runner karma-jasmine


    【解决方案1】:

    如果您对打开 Karma 为您生成的 HTML 报告感到满意,请查看 karma-html-reporter。只需将其添加到您的 Karma 配置中的记者列表中:

    {
      // much more before this
    
      reporters: ['progress', 'html'],
    
      // the default configuration
      htmlReporter: {
        outputDir: 'karma_html', // where to put the reports 
        templatePath: null, // set if you moved jasmine_template.html
        focusOnFailures: true, // reports show failures on start
        namedFiles: false, // name files instead of creating sub-directories
        pageTitle: null, // page title for reports; browser info by default
        urlFriendlyName: false // simply replaces spaces with _ for files/dirs
    
        // experimental
        preserveDescribeNesting: false, // folded suites stay folded 
        foldAll: false, // reports start folded (only with preserveDescribeNesting)
      }
    
      // much more after this
    }
    

    【讨论】:

    • 谢谢。我会试试看!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-02-24
    • 2014-05-24
    • 2014-01-12
    • 2018-03-28
    • 1970-01-01
    • 2015-09-29
    • 1970-01-01
    相关资源
    最近更新 更多