HTML Reports for Pest PHP Tests
Generate interactive HTML reports directly from your test resultsto better understand and work with your test suite.
Features
- ๐ Generate static HTML reports from Pest test results JSON
- ๐ Search UI to find test cases and dig deeper than you ever did before
- ๐ Editor deep links (PhpStorm, VS Code, Sublime Text, Vim)
- ๐ GitHub linking for PRs and issues (using Pest's
->todo(issue: 123)annotations) - ๐ Use Markdown in your test case notes (
->note('Note with **bold** text')) - ๐ฆ HTML report is completely self-contained in a single file (Tailwind + Alpine from CDN)
Installation
Install the package via Composer:
composer require mateffy/pest-plugin-html-reportsUsage
Command Line
Generate a static HTML report from a test results JSON file:
php artisan test-report:generate# With some extra options
php artisan test-report:generate \
--input=storage/app/pest_test_results.json \
--output=public/pest-report.html \
--title="My Project Test Results" \
--project-path=/path/to/your/project \
--repository=your-username/your-repoEnvironment Variables
You can configure the output directory and filename of the JSON report by setting the following environment variables:
TEST_REPORT_DIR: The directory where the JSON report will be saved. Defaults tostorage/framework/testing/reports.TEST_REPORT_FILENAME: The filename of the JSON report. Defaults toreport-{{date}}-{{id}}.json. The{{date}}and{{id}}placeholders will be replaced with the current date and a unique ID.
How it works
- A Pest test is run
- A pest plugin is used to listen to the test completion event and loads the required data from the Pest internals
- The data is then stored as a JSON file per run in the
storage/framework/testing/reportsdirectory - Depending on your configuration, a HTML report is automatically generated and also stored in the
storage/framework/testing/reportsdirectory. - Later on, the
artisan test-report:generatecommand can be used to generate a static HTML report from any of the historic JSON files
License
MIT License
On this page
Languages
PHP65.6%Blade34.4%
Contributors
Created August 6, 2025
Updated October 10, 2025


