danger-simplecov_json
Report your Ruby app test suite code coverage in Danger.
Before using this plugin, you need to setup your project to use SimpleCov to get code coverage information and simplecov-json to format it as JSON.
How does it look?
<tr>
<td>:book:</td>
<td data-sticky="true">Code coverage is now at 99.15% (1512/1525 lines)</td>
</tr>
1 Message |
---|
Installation
Add this line to your Gemfile:
gem 'danger-simplecov_json'
Usage
Just add this line to your Dangerfile
:
simplecov.report 'coverage/coverage.json'
You can also make the message not sticky:
simplecov.report('coverage/coverage.json', sticky: false)
Individual File coverage
In addition, you can see coverage for the files you've added or modified in git:
simplecov.individual_report('coverage/coverage.json', Dir.pwd)
License
MIT
Development
- Clone this repo
- Run
bundle install
to setup dependencies. - Run
bundle exec rake spec
to run the tests. - Use
bundle exec guard
to automatically have tests run as you make changes. - Make your changes.