karma-runner / karma-runner/karma-coverage
Code coverage: how to cover code in <script> tag in html files?
- Dominant language
- JavaScript
- Stars
- 771
- Forks
- 242
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I am working with lots of html files, each of them containing tags.
I am testing these, and they are working correctly.
But, the code coverage is reporting nothing about theses files. And I would like them to do so.
Html files are about (they are polymerjs component):
```
<dom-module name="epc-catched-network-request">
<script>
.. code to be tested against code-coverage ..
```
In my karma.conf.js, I have this code:
```
...
preprocessors: {
'framework/*.js': [ 'coverage' ],
'framework/*.html': [ 'coverage' ],
'framework/!(bower_components)/**/*.js': [ 'coverage' ],
'framework/!(bower_components)/**/*.html': [ 'coverage' ],
},
...
```
Any clue on how to have some code coverage report taking code in this tags?
Contributor guide
Research direction
Start with the karma.conf.js preprocessors shown in the issue and reproduce coverage for the framework/*.html and framework/!(bower_components)/**/*.html patterns. Inspect how coverage handles JavaScript embedded in HTML, then define completion as coverage output that includes the code inside the component’s tags.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100