Comments (5)
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.
@vojtajina yes I got your point. And it would be indeed better if Karma could propose a generic solution for that.
from karma-mocha.
It would be great to have this feature 👍
from karma-mocha.
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.
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)
- Passed --grep option persists across test runs HOT 1
- npm test - Uncaught ReferenceError: describe is not defined HOT 3
- No provider for "framework:mocha"! (Resolving: framework:mocha) HOT 11
- karma tests slowed down with mocha 4
- Applying polyfill before loading mocha HOT 6
- Can I keep tests in a normal mocha index.html? HOT 3
- Delay __karma__.start() until es6 test modules have been loaded HOT 1
- maintainers and status of project HOT 4
- Usage of exact version of minimist HOT 4
- When will commit: 36404cf36aa5150f839c98d10baa8c642faad098 will be relaesed? HOT 1
- Uncaught exception: emitting a 'test end' event for a hook HOT 1
- Redundant Mocha Reporter Node <div id="mocha"></div> HOT 1
- Uncaught exceptions in between Mocha tests are not reported HOT 2
- Support for mocha root hooks
- adapter.js swallows failures that occur after test complete
- Unit tests are missing when `script type="module"` takes >= 3ms before `describe` HOT 1
- Reestablish CI/CD with GitHub Actions
- The dependency minimist "^1.2.3" is declared as vulnerable need to update to 1.2.6 or more HOT 1
- Status of this project? HOT 4
- Analysis: 76% of dependency updates in this repository can be merged.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-mocha.