karma-runner / karma-runner/karma-coverage

TypeError: cannot read property 'split' of undefined

Open
#278 11 comments 8 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
771
Forks
242
PR merge metrics
No merged PRs in 30d

Description

Hi,

version: 1.1.1

I am using Karma-coverage to generate lcov report with in-memory report like this:
```
coverageReporter: {
dir: 'reports/',
reporters: [
{ type: 'in-memory' },
{ type: 'lcov', subdir: 'report-lcov' },
]
},
```
I am getting the error:
```
TypeError: Cannot read property 'split' of undefined
at HtmlReport.writeDetailPage ({path}\node_modules\istanbul\lib\report\html.js:412:28)
```
I tried modifying the html.js to see the result. coverage is sending undefined value to istanbul in the end.
My reports are generating properly, but this error fails my build.
Is there a fix to it?

Contributor guide

Open the contributing guide

Research direction

Start with the reported failure in istanbul/lib/report/html.js at HtmlReport.writeDetailPage, then trace the in-memory and lcov reporter paths from the supplied coverageReporter configuration. Reproduce the build with Karma-coverage 1.1.1 and inspect where the undefined value reaches Istanbul. Done means the reports still generate without the split error and the build succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.