{"action":"closed","issue":{"url":"https://api.github.com/repos/SBoudrias/gulp-istanbul/issues/58","labels_url":"https://api.github.com/repos/SBoudrias/gulp-istanbul/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/SBoudrias/gulp-istanbul/issues/58/comments","events_url":"https://api.github.com/repos/SBoudrias/gulp-istanbul/issues/58/events","html_url":"https://github.com/SBoudrias/gulp-istanbul/issues/58","id":68633023,"number":58,"title":"Enforce thresholds feature","user":{"login":"peterjwest","id":246023,"avatar_url":"https://avatars.githubusercontent.com/u/246023?v=3","gravatar_id":"","url":"https://api.github.com/users/peterjwest","html_url":"https://github.com/peterjwest","followers_url":"https://api.github.com/users/peterjwest/followers","following_url":"https://api.github.com/users/peterjwest/following{/other_user}","gists_url":"https://api.github.com/users/peterjwest/gists{/gist_id}","starred_url":"https://api.github.com/users/peterjwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterjwest/subscriptions","organizations_url":"https://api.github.com/users/peterjwest/orgs","repos_url":"https://api.github.com/users/peterjwest/repos","events_url":"https://api.github.com/users/peterjwest/events{/privacy}","received_events_url":"https://api.github.com/users/peterjwest/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SBoudrias/gulp-istanbul/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-15T09:56:04Z","updated_at":"2015-05-07T16:04:20Z","closed_at":"2015-05-07T16:04:20Z","body":"Would you mind if I make a PR to add threshold enforcing support?\r\n\r\nIstanbul has this feature but unfortunately the logic is embedded within a [console command](https://github.com/gotwarlost/istanbul/blob/master/lib/command/check-coverage.js#L157-L180) which only reads from a coverage file.\r\n\r\nI imagined it would look like this:\r\n\r\n    .pipe(mocha())\r\n    .pipe(istanbul.writeReports())\r\n    .pipe(istanbul.enforceThresholds(thresholds))\r\n    .on('end', cb);\r\n\r\nAll this would do is check the coverage against thresholds, output a short message and then create a plugin error if the coverage failed."}}