Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit 574d7af

Browse files
committed
Add a Composer script for generating test coverage
1 parent e48b3e5 commit 574d7af

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,13 @@ Once master has been updated, the release should be tagged, then `master` should
4747
WooCommerce Custom Order Tables uses [the WordPress core testing suite](https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/) to provide automated tests for its functionality.
4848

4949
When submitting pull requests, please include relevant tests for your new features and bugfixes. This helps prevent regressions in future iterations of the plugin, and helps instill confidence in store owners using this to enhance their WooCommerce stores.
50+
51+
#### Test coverage
52+
53+
To generate a code coverage report (test coverage percentage as well as areas of untested or under-tested code that could pose risk), you run the following:
54+
55+
```sh
56+
$ composer test-coverage
57+
```
58+
59+
The report will be saved to `tests/coverage/`. Please note that XDebug must be enabled in order to generate code coverage reports!

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
],
2424
"post-autoload-dump": [
2525
"xrstf\\Composer52\\Generator::onPostInstallCmd"
26+
],
27+
"test-coverage": [
28+
"phpunit --coverage-html=tests/coverage"
2629
]
2730
}
2831
}

0 commit comments

Comments
 (0)