Giter Site home page Giter Site logo

Comments (5)

vojtajina avatar vojtajina commented on August 9, 2024

Yep, this is possible. You can detect the "debug" by checking window.location and then register the HTML reporter.

That said, the reporter will live in the same document as the actual tests and so if you tests use the DOM, it might conflict with each other; for instance your test might add some div into the body and then expect there is one div (ok, this is stupid, but you know what I mean;-)), then the reporter produces additional divs and so the debug will behave differently than the regular run. Also your tests can destroy the HTML reporter output.

So I'm not sure if this is desired/worthy.

If it is, it might be better to write an HTML reporter on using Karma's API (rather than Mocha) and then use it independently of Mocha (you could use it even with Jasmine/QUnit, etc..)

What do other people think?

from karma-mocha.

alexstrat avatar alexstrat commented on August 9, 2024

@vojtajina yes I got your point. And it would be indeed better if Karma could propose a generic solution for that.

from karma-mocha.

fredericgrati avatar fredericgrati commented on August 9, 2024

It would be great to have this feature 👍

from karma-mocha.

chadwithuhc avatar chadwithuhc commented on August 9, 2024

I agree this should be included. The whole reason I chose Mocha was for the HTML reporter. In the mean time I am using @maksimr 's plugin karma-mocha-debug, but this should be a default for the karma-mocha plugin.

from karma-mocha.

maksimr avatar maksimr commented on August 9, 2024

I think when we fix this issue.

We will can define reporter for debug.html in karma.conf.js like:

...
client: {
  mocha: {
    reporter: '<reporter>'
  }
}
...

from karma-mocha.

Related Issues (20)

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.