Our documentation is still under construction, please reach out to chat support in the bottom right corner if your queries cannot be answered here.

Type Coverage

Pest PHP

Pest PHP offers tracking of type coverage through a plug-in. You can see more in our blog post about pest type coverage and the Pest PHP documentation.

Using Pest PHP to track type coverage is incredibly straightforward, and you don't even need to use Pest PHP to run your test suite, to take advantage of type coverage tracking. You must first install the Pest Type Coverage plugin:

1. Install Pest Type Coverage Plugin

composer require pestphp/pest-plugin-type-coverage --dev

2. Add Type Coverage to CI steps

This must be added to your CI workflow file, before the OtterWise script.

- name: Calculate type coverage
  run: vendor/bin/pest --type-coverage --type-coverage-json=pest-type-coverage.json

And that's it! OtterWise will automatically look for a pest-type-coverage.json file in your project root.