A Danger plugin to report code coverage.
This plugin detects and parses coverage reports, posting the results as a Markdown table back to the pull request.
View an example report
Test coverage is looking a little low for the files created or modified in this PR, perhaps we need to improve this.
Coverage threshold for branches (80%) not met: 49.08% Coverage threshold for functions (80%) not met: 74.46%
|Impacted Files||% Stmts||% Branch||% Funcs||% Line||Uncovered Lines|
|src/module-two.js||95.24||33.33||66.67||80||1, 42, 1337...||❌|
|src/module-three.js||82.33||10.25||44.55||45.55||12, 15, 32...||❌|
|src/module-four.js||100||0||10||32.5||54, 65, 94...||❌|
yarn add danger-plugin-coverage --dev
At a glance:
Note that the coverage report output by your test runner must exist before Danger
is run. By default we will look for the report at
is the default output location for Jest.
The function accepts a settings object with the following properties:
||A custom message to show when coverage is above the threshold.|
||A custom message to show when coverage is below the threshold.|
||Override automatic coverage report detection to provide the relative path to a report.|
||The number of rows to show (additional rows will be collapsed within a
||The maximum number of characters to allow in a file name cell.|
||The maximum number of uncovered lines to show.|
||Wrap long file names to help the table fit in a PR comment.|
||The thresholds at which to show the failure messaging.|
||Show a warning if no coverage report was detected.|
Example (defaults shown):