{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/159","repository_url":"https://api.github.com/repos/sindresorhus/gulp-mocha","labels_url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/159/comments","events_url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/159/events","html_url":"https://github.com/sindresorhus/gulp-mocha/issues/159","id":210340601,"number":159,"title":"Code Coverage reported as 0% after upgrading from 3.0.1 to 4.0.1","user":{"login":"ek9","id":17393048,"avatar_url":"https://avatars3.githubusercontent.com/u/17393048?v=3","gravatar_id":"","url":"https://api.github.com/users/ek9","html_url":"https://github.com/ek9","followers_url":"https://api.github.com/users/ek9/followers","following_url":"https://api.github.com/users/ek9/following{/other_user}","gists_url":"https://api.github.com/users/ek9/gists{/gist_id}","starred_url":"https://api.github.com/users/ek9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ek9/subscriptions","organizations_url":"https://api.github.com/users/ek9/orgs","repos_url":"https://api.github.com/users/ek9/repos","events_url":"https://api.github.com/users/ek9/events{/privacy}","received_events_url":"https://api.github.com/users/ek9/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-02-26T19:20:19Z","updated_at":"2017-05-29T16:36:08Z","closed_at":null,"body":"I am experiencing a weird issue where upgrading `gulp-mocha` from `3.0.1` to `4.0.1` causes code coverage to no longer work. The tests run as before, but istanbul is no longer able to pick things up and it reports 0% code coverage.\r\n\r\nThis affects this PR https://github.com/ek9/generator-license-cc/pull/25/files\r\n\r\nTest coverage before update ( https://travis-ci.org/ek9/generator-license-cc/jobs/195271001 ):\r\n\r\n```\r\n  21 passing (1s)\r\n\r\n-----------|----------|----------|----------|----------|----------------|\r\n\r\nFile       |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |\r\n\r\n-----------|----------|----------|----------|----------|----------------|\r\n\r\n app/      |      100 |     93.1 |      100 |      100 |                |\r\n\r\n  index.js |      100 |     93.1 |      100 |      100 |                |\r\n\r\n-----------|----------|----------|----------|----------|----------------|\r\n\r\nAll files  |      100 |     93.1 |      100 |      100 |                |\r\n\r\n-----------|----------|----------|----------|----------|----------------|\r\n```\r\n\r\nTest coverage after update ( https://travis-ci.org/ek9/generator-license-cc/jobs/205308602 ):\r\n\r\n```\r\n  21 passing (950ms)\r\n\r\n-----------|----------|----------|----------|----------|----------------|\r\n\r\nFile       |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |\r\n\r\n-----------|----------|----------|----------|----------|----------------|\r\n\r\n app/      |        0 |        0 |        0 |        0 |                |\r\n\r\n  index.js |        0 |        0 |        0 |        0 |... 294,295,297 |\r\n\r\n-----------|----------|----------|----------|----------|----------------|\r\n\r\nAll files  |        0 |        0 |        0 |        0 |                |\r\n\r\n-----------|----------|----------|----------|----------|----------------|\r\n```\r\n\r\n`gulpfile.js`\r\n\r\n```js\r\n'use strict';\r\nvar path = require('path');\r\nvar gulp = require('gulp');\r\nvar eslint = require('gulp-eslint');\r\nvar excludeGitignore = require('gulp-exclude-gitignore');\r\nvar mocha = require('gulp-mocha');\r\nvar istanbul = require('gulp-istanbul');\r\nvar nsp = require('gulp-nsp');\r\nvar plumber = require('gulp-plumber');\r\nvar coveralls = require('gulp-coveralls');\r\n\r\n// ... some parts omitted ...\r\n\r\ngulp.task('pre-test', function () {\r\n  return gulp.src('app/*.js')\r\n    .pipe(excludeGitignore())\r\n    .pipe(istanbul({\r\n      includeUntested: true\r\n    }))\r\n    .pipe(istanbul.hookRequire());\r\n});\r\n\r\ngulp.task('test', ['pre-test'], function (cb) {\r\n  var mochaErr;\r\n\r\n  gulp.src('test/**/*.js')\r\n    .pipe(plumber())\r\n    .pipe(mocha({reporter: 'spec'}))\r\n    .on('error', function (err) {\r\n      mochaErr = err;\r\n    })\r\n    .pipe(istanbul.writeReports())\r\n    .on('end', function () {\r\n      cb(mochaErr);\r\n    });\r\n});\r\n```\r\nFor full source you can check the PR or repository https://github.com/ek9/generator-license-cc/pull/25#issuecomment-282495158"},"comment":{"url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/comments/304697950","html_url":"https://github.com/sindresorhus/gulp-mocha/issues/159#issuecomment-304697950","issue_url":"https://api.github.com/repos/sindresorhus/gulp-mocha/issues/159","id":304697950,"user":{"login":"Enet4","id":4738426,"avatar_url":"https://avatars3.githubusercontent.com/u/4738426?v=3","gravatar_id":"","url":"https://api.github.com/users/Enet4","html_url":"https://github.com/Enet4","followers_url":"https://api.github.com/users/Enet4/followers","following_url":"https://api.github.com/users/Enet4/following{/other_user}","gists_url":"https://api.github.com/users/Enet4/gists{/gist_id}","starred_url":"https://api.github.com/users/Enet4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enet4/subscriptions","organizations_url":"https://api.github.com/users/Enet4/orgs","repos_url":"https://api.github.com/users/Enet4/repos","events_url":"https://api.github.com/users/Enet4/events{/privacy}","received_events_url":"https://api.github.com/users/Enet4/received_events","type":"User","site_admin":false},"created_at":"2017-05-29T16:36:08Z","updated_at":"2017-05-29T16:36:08Z","body":"Sounds unlikely. The discussions suggest that there isn't a trivial fix. Consider using `gulp-mocha` 3 instead."}}
{"actor":{"display_login":"Enet4"}}