dylanb / gulp-coverage

Gulp coverage reporting for Node.js that is independent of the test runner
MIT License
60 stars 12 forks source link

TypeError: Reduce of empty array with no initial value #30

Closed mbrevda closed 9 years ago

mbrevda commented 9 years ago

I received the following error after making this change. Coverage worked fine before than.

PROJECT_DIR/backbone/kinView/node_modules/gulp-coverage/contrib/cover.js:660
    interim.reduce(function(p, c) {
            ^
TypeError: Reduce of empty array with no initial value
    at Array.reduce (native)
    at linesWithData (PROJECT_DIR/backbone/kinView/node_modules/gulp-coverage/contrib/cover.js:660:13)
    at PROJECT_DIR/backbone/kinView/node_modules/gulp-coverage/contrib/cover.js:770:21
    at Array.forEach (native)
    at CoverageSession.allStats (PROJECT_DIR/backbone/kinView/node_modules/gulp-coverage/contrib/cover.js:758:31)
    at Transform._flush (PROJECT_DIR/backbone/kinView/node_modules/gulp-coverage/index.js:76:31)
    at Transform.<anonymous> (PROJECT_DIR/backbone/kinView/node_modules/gulp-coverage/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:135:12)
    at Transform.g (events.js:180:16)
    at Transform.emit (events.js:92:17)
    at finishMaybe (PROJECT_DIR/backbone/kinView/node_modules/gulp-coverage/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:371:12)
mbrevda commented 9 years ago

Thanks for the speedy fix! Do you have an ETA for a version bump so that I can npm update?

dylanb commented 9 years ago

I will do that asap

mbrevda commented 9 years ago

thanks!

On Thu, Sep 18, 2014 at 11:54 PM, Dylan Barrell notifications@github.com wrote:

I will do that asap

— Reply to this email directly or view it on GitHub https://github.com/dylanb/gulp-coverage/issues/30#issuecomment-56101615.

dylanb commented 9 years ago

updated 0.3.28

mbrevda commented 9 years ago

perfect, works great!

On Thu, Sep 18, 2014 at 11:56 PM, Dylan Barrell notifications@github.com wrote:

updated 0.3.28

— Reply to this email directly or view it on GitHub https://github.com/dylanb/gulp-coverage/issues/30#issuecomment-56101922.