Giter VIP home page Giter VIP logo

karma-html-reporter's People

Contributors

0xr avatar dependabot[bot] avatar dtabuenc avatar jardilio avatar jonathanargentiero avatar jonyio avatar kopernic-pl avatar methodgrab avatar mikematusz avatar nmccready avatar shawnfumo avatar targos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

karma-html-reporter's Issues

Cut a new patch release?

@dtabuenc you've included a number of vulnerability updates (e.g., lodash ^4.17.13 to address CVE-2019-10744). I'm certain other projects that depend on karma-html-reporter are getting flagged for these vulnerabilities due to transitive dependencies. Would you be able to cut a patch release (v0.2.8)?

TypeError with io.js v 2.3.0

ERROR [karma]: [TypeError: options must be a string or an object]
TypeError: options must be a string or an object
    at new WriteStream (fs.js:1798:11)
    at Object.fs.createWriteStream (fs.js:1784:10)
    at c:\Users\<username>\Documents\Aptana Studio 3 Workspace\admin-gui\node_modules\karma-html-reporter\index.js:89:22
    at FSReqWrap.oncomplete (fs.js:82:15)
.write(string, encoding, offset, length) is deprecated. Use write(string[, offset[, length]][, encoding]) instead.

Getting Invalid config file Error

Hello, I just wanted to let you know that with this reporter, I am getting the following error:

ERROR [config]: Invalid config file!
SyntaxError: Unexpected identifier.

My command prompt tells me that the error is on the following line of code:

reporters: ['progress', 'html'],

However, I'm following the instructions outlined on both the npm page and the github account.

Any ideas on what I might be doing wrong?

NPM Project
https://www.npmjs.com/package/karma-html-reporter

Only one browser's results show

I have three browsers being tested: Firefox, Chrome, and Edge. However, only one browser's results show up. It's typically Firefox, but it's sometimes Chrome.

object object object

When viewing the file in the browser, it does not show what is in the describe it shows [object Object]. I started looking at this and discovered that the suitesToArray function the suiteName is actually coming out as [object Object] from _.map ?

deprecated write api

on node 0.12, latest karma i get this warning when using karma-html-reporter
.write(string, encoding, offset, length) is deprecated. Use write(string[, offset[, length]][, encoding]) instead.

This reporter causes karma to crash for small errors.

Example:

INFO [launcher]: Starting browser Chrome
INFO [Chrome 35.0.1916 (Mac OS X 10.8.5)]: Connected on socket EK2rYY15FeDz98z-wxD4 with id 75186479
Chrome 35.0.1916 (Mac OS X 10.8.5) ERROR
  Uncaught Error: Module name "user.controller" has not been loaded yet for context: _
  http://requirejs.org/docs/errors.html#notloaded
  at /Users/user/Sites/project/node_modules/requirejs/require.js:141
ERROR [karma]: [TypeError: Cannot set property 'results' of undefined]
TypeError: Cannot set property 'results' of undefined
    at onBrowserComplete (/Users/user/Sites/project/node_modules/karma-html-reporter/index.js:43:25)
    at null.<anonymous> (/Users/user/Sites/project/node_modules/karma/lib/events.js:15:22)
    at EventEmitter.emit (events.js:117:20)
    at onComplete (/Users/user/Sites/project/node_modules/karma/lib/browser.js:145:13)
    at Socket.<anonymous> (/Users/user/Sites/project/node_modules/karma/lib/events.js:15:22)
    at Socket.EventEmitter.emit [as $emit] (events.js:117:20)
    at SocketNamespace.handlePacket (/Users/user/Sites/project/node_modules/karma/node_modules/socket.io/lib/namespace.js:335:22)
    at Manager.onClientMessage (/Users/user/Sites/project/node_modules/karma/node_modules/socket.io/lib/manager.js:518:38)
    at WebSocket.Transport.onMessage (/Users/user/Sites/project/node_modules/karma/node_modules/socket.io/lib/transport.js:369:20)
    at Parser.<anonymous> (/Users/user/Sites/project/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:39:10)

Also crashes if an extra }, ) function, var f = ; etc.
All small errors.
Karma does not crash if this reporter is disabled.
Just a heads up.

Suites are undefiend

Fatal error: Cannot read property 'suites' of undefined

In new Karma, template does not work.

preserveDescribeNesting nests incorrectly

Hi

I am getting an incorrectly nesting if I have two test files where only one has deeply nested describe.

Here is the output from my text console when running:

  Group 1 - No nesting
    ✔ displays correctly
  Group 2 - No nesting
    ✔ Displays correctly
  Group with nesting
    Nested "describe" block
      ✔ should display inside "group with nesting" (skipped)
      ✔ should still display inside "group with nesting" (skipped)

I extracted this example from a private repository.

The above structure is what I expect. However, the HTML report incorrectly displays the nested describe block as being below Group 2. And the heading Group with nesting disappears!

something like this is displayed:

  Group 1 - No nesting
    ✔ displays correctly
  Group 2 - No nesting
    ✔ Displays correctly
    Nested "describe" block #UH OH! NESTED BELOW WRONG GROUP!!!
      ✔ should display inside "group with nesting" (skipped)
      ✔ should still display inside "group with nesting" (skipped)

It appears as if Nested "describe" block were added directly below Group 2, which is incorrect.

Can you help me debugging this strange thing? Or, can you help me with a test that can show this error in the source code.

Support karma 0.11

Currently this reporter is broken if used with karma 0.11. It seems that all karma reporter plugins have to be fixed to be compatible with 0.11.
See this for example.

Open html file automatically

Hello, maybe I didn't undestood how it works, but is there a chance of opening the resulted html in the browser?

The Karma runner by default opens and shows the status of the tests, and I would want to show the results in another browser tab

TypeError: Cannot read property 'suites' of undefined

I was trying to test this reporter and when I ran my test suite I got the following error.

INFO [reporter.osx]: OSX Notification Center reporter started at http://localhost:1337
INFO [karma]: Karma v0.10.10 server started at http://localhost:9876/
INFO [launcher]: Starting browser Safari
INFO [reporter.osx]: node-osx-notifier exited with code 8
INFO [Safari 7.0.3 (Mac OS X 10.9.2)]: Connected on socket 76zbAucpGbOAabZx085C
Safari 7.0.3 (Mac OS X 10.9.2): Executed 1 of 197 SUCCESS (0 secs / 0.019 secs)
ERROR [karma]: [TypeError: Cannot read property 'suites' of undefined]
TypeError: Cannot read property 'suites' of undefined
  at getOrCreateSuite (/Users/ryan/Source/webview/node_modules/karma-html-reporter/index.js:99:42)
  at [object Object].specSuccess.specSkipped.specFailure (/Users/ryan/Source/webview/node_modules/karma-html-reporter/index.js:85:15)
  at [object Object].onSpecComplete (/Users/ryan/Source/webview/node_modules/karma/lib/reporters/Base.js:80:12)
  at [object Object].EventEmitter.emit (events.js:117:20)
  at [object Object].onResult (/Users/ryan/Source/webview/node_modules/karma/lib/browser.js:177:13)
  at Socket.EventEmitter.emit [as $emit] (events.js:117:20)
  at SocketNamespace.handlePacket (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/namespace.js:335:22)
  at Manager.onClientMessage (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/manager.js:488:38)
  at WebSocket.Transport.onMessage (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transport.js:387:20)
  at Parser.<anonymous> (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:39:10)
  at Parser.EventEmitter.emit (events.js:95:17)
  at finish (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:288:16)
  at Parser.expectHandler (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:299:15)
  at Parser.add (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
  at Parser.expect (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:499:10)
  at Parser.<anonymous> (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:298:18)
  at Parser.add (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
  at Parser.expect (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:499:10)
  at expectData (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:296:16)
  at Parser.<anonymous> (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:317:11)
  at Parser.add (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
  at Parser.expect (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:499:10)
  at Parser.opcodeHandlers.1 (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:316:14)
  at Parser.processPacket (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:533:8)
  at Parser.add (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
  at Socket.<anonymous> (/Users/ryan/Source/webview/node_modules/karma/node_modules/socket.io/lib/transports/websocket/hybi-16.js:141:17)
  at Socket.EventEmitter.emit (events.js:117:20)
  at Socket.<anonymous> (_stream_readable.js:746:14)
  at Socket.EventEmitter.emit (events.js:92:17)
  at emitReadable_ (_stream_readable.js:408:10)
  at emitReadable (_stream_readable.js:404:5)
  at readableAddChunk (_stream_readable.js:165:9)
  at Socket.Readable.push (_stream_readable.js:127:10)
  at TCP.onread (net.js:528:21)

Help?

Upsets other plugins

console    INFO  07 06 2016 13:31:54.538:WARN [preprocess]: Can not load "coverage", it is not registered!
  Perhaps you are missing some plugin?
console    INFO  07 06 2016 13:31:54.544:WARN [reporter]: Can not load "spec", it is not registered!
  Perhaps you are missing some plugin?
console    INFO  07 06 2016 13:31:54.544:WARN [reporter]: Can not load "junit", it is not registered!
  Perhaps you are missing some plugin?
console    INFO  07 06 2016 13:31:54.544:WARN [reporter]: Can not load "coverage", it is not registered!
  Perhaps you are missing some plugin?
[13:31:54] console    INFO  '_karma-jenkins' errored after 37 ms
[13:31:54] console    INFO  Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
    at error (D:\src\thin-monitor2\node_modules\di\lib\injector.js:22:12)
    at Object.parent.get (D:\src\thin-monitor2\node_modules\di\lib\injector.js:9:13)
    at get (D:\src\thin-monitor2\node_modules\di\lib\injector.js:54:19)
    at D:\src\thin-monitor2\node_modules\karma\lib\server.js:138:20
    at Array.forEach (native)
    at Server._start (D:\src\thin-monitor2\node_modules\karma\lib\server.js:137:21)
    at invoke (D:\src\thin-monitor2\node_modules\di\lib\injector.js:75:15)
    at Server.start (D:\src\thin-monitor2\node_modules\karma\lib\server.js:102:18)
    at Gulp.<anonymous> (D:\src\thin-monitor2\gulp-tasks\testing-tasks.js:106:5)
    at module.exports (D:\src\thin-monitor2\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (D:\src\thin-monitor2\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (D:\src\thin-monitor2\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (D:\src\thin-monitor2\node_modules\orchestrator\index.js:134:8)
    at runNextSet (D:\src\thin-monitor2\node_modules\run-sequence\index.js:88:16)
    at Gulp.onTaskEnd (D:\src\thin-monitor2\node_modules\run-sequence\index.js:77:5)
    at emitOne (events.js:82:20)
    config.set({

        reporters: ['spec', 'junit', 'coverage', 'html'],

        // the default configuration
        htmlReporter: {
            outputDir: process.env.WORKSPACE || '../reports/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: 'ThinMonitor2 Unit Tests', // page title for reports; browser info by default
            urlFriendlyName: true, // simply replaces spaces with _ for files/dirs
            // reportName: 'report-summary-filename' // report summary filename; browser info by default
        },

        plugins: [
            'karma-html-reporter'
        ],

        junitReporter : {
            outputDir: process.env.WORKSPACE || '../reports/jUnit', // results will be saved as $outputDir/$browserName.xml
            outputFile: 'test-results.xml',
            useBrowserName: false // add browser name to report and classes names
        },

        coverageReporter: {
            reporters:[
                {
                    type : 'cobertura',
                    dir : '../reports/coverage/cobertura/'
                },
                {
                    type: 'html',
                    dir: '../reports/coverage/html/'
                },
                {
                    type: 'text-summary'
                    // dir: '../reports/coverage/text/'
                }
            ]
        },
        preprocessors:  {
            '../src/js/**/*.js': 'coverage'
        },

        frameworks: ['jasmine', 'jasmine-matchers'],

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

        // For headless Chrome, see  https://gist.github.com/addyosmani/5336747
        // We really ought to test on the same client the end-users use
        browsers: ['PhantomJS'],

        files: [
                      ...
        ],

        exclude: [
            'js/app.js' // Not used in tests: see ../test/lib/jasmine-tr.js for instantiation of thinMonitor.
        ],

        port: 9876,

        colors: false,

        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
        logLevel: config.LOG_INFO,

        autoWatch: false,

        // Concurrency level
        // how many browser should be started simultaneous
        concurrency: Infinity
    });

More story like

Is it possible to have an output like karma-story-reporter, with a tree.

Currently

  • main controller methodA
    • should do this
    • should to that
  • main controller methodB
    • should do this
    • should to that

Expected

  • main controller
    • methodA
      • should to this
      • should do that
    • methodB
      • should to this
      • should do that

I think it's easier to read

Update lodash, to address npm audit results

Running npm audit on a project that uses karma-html-reporter includes output like:

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.11                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ 80dd5990e7597a6d3477fd57c9c80cb2efe87974eb098711a1cf87cab15… │
│               │ [dev]                                                        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ 80dd5990e7597a6d3477fd57c9c80cb2efe87974eb098711a1cf87cab15… │
│               │ > karma-html-reporter > lodash                               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/782                       │
└───────────────┴──────────────────────────────────────────────────────────────┘

If dependency on lodash gets updated, then there'd be no issues reported for karma-html-reporter.

Tabular form report

Hi, How can I get report in tabular form with time taken for test execution?
Do I need to update jasmine_template.html for it? If yes, how to implement?

Debug page is just a blank page on Ubuntu Precise

My package.json dependencies:

 "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-typescript": "^2.12.1",
    "jasmine": "^2.4.1",
    "karma": "~0.13.22",
    "karma-chrome-launcher": "~0.2.3",
    "karma-jasmine": "^0.3.7",
    "run-sequence": "^1.1.5",
    "typescript": "^1.8.7",
    "karma-html-reporter": "~0.2.7",
    "karma-unicorn-reporter": "~0.1.4"
  }

My karma.conf.js reporters line: reporters: ['progress', 'html'],

My gulp task that runs without problems:

gulp.task('test', function(){
  exec('karma start', function(err){
    console.log(err ? err : 'Karma server running');
  });
});

When I run karma start without gulp I get the report through the terminal (Executed x of x SUCCESS), but as when I use gulp, the debug page remains blank. (I'm using chrome browsers: ['Chrome'],)

Breaks on Node.js 4.x

karma-html-reporter doesn't play nice with node 4.x
An old API is used to handle writeStream errors, which now throws an error.

Here's the stack trace:

TypeError: options must be a string or an object
    at new WriteStream (fs.js:1799:11)
    at Object.fs.createWriteStream (fs.js:1785:10)
    at /home/RIAstar/dev/trasys/seed/angular-app-seed/node_modules/karma-html-reporter/index.js:89:22
    at /home/RIAstar/dev/trasys/seed/angular-app-seed/node_modules/karma/lib/helper.js:82:7

Only first suite is output to HTML

Karma runs 58 tests of mine, but only the first suite is ever displayed.

Passing 58 specs

App namespace
  should be defined
  should be defined
  should be defined

And the rest of index.html is blank. I am running version 0.1.1 of karma-html-reporter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.