karma-runner / karma-runner/karma-coverage

TypeError: Cannot read property 'text' of undefined

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

Description

I'm facing 1 issue on my Unit Test. It happens when I tried to add `babelify` into `browerify`'s transform to convert ES6 in my implement code.

```
browserify: {
transform: ['babelify', 'reactify', 'istanbulify'],
extensions: ['.js', '.jsx'],
debug: true,
bundleDelay: 1000, // WAR for karma-browserify race condition
},
```

I'm using:
- Istanbul: `0.3.17`
- karma-coverage: `0.4.2`
- babelify: `6.1.2`

Chrome 43.0.2357 (Mac OS X 10.10.2): Executed 313 of 324 (skipped 11) SUCCESS (0.515 secs / 0.313 secs)

ERROR [coverage]: [TypeError: Cannot read property 'text' of undefined]
TypeError: Cannot read property 'text' of undefined
at /node_modules/istanbul/lib/report/html.js:283:53
at Array.forEach (native)
at annotateBranches (/node_modules/istanbul/lib/report/html.js:250:30)
at HtmlReport.Report.mix.writeDetailPage (/node_modules/istanbul/lib/report/html.js:421:9)
at /node_modules/istanbul/lib/report/html.js:484:26
at SyncFileWriter.extend.writeFile (/node_modules/istanbul/lib/util/file-writer.js:57:9)
at FileWriter.extend.writeFile (/node_modules/istanbul/lib/util/file-writer.js:147:23)
at /node_modules/istanbul/lib/report/html.js:483:24
at Array.forEach (native)
at HtmlReport.Report.mix.writeFiles (/node_modules/istanbul/lib/report/html.js:477:23)

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the shown browserify transforms and package versions, then inspect node_modules/istanbul/lib/report/html.js around annotateBranches at lines 250-283 and the karma-coverage integration. Done means the existing unit-test run completes without the TypeError and produces an HTML coverage report.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.