Tests
Use Vroni to add tests to untested code, reproduce a bug before fixing it, or cover one part of your app more thoroughly.
Writing tests is useful work that rarely takes priority over a new feature, which makes it a good job to hand off to Vroni. You point out the code and the cases that matter. Vroni writes the tests using your project’s existing test setup, runs them, and opens a pull request.
This page covers how to write a test task, what to do if new tests uncover a bug, and how to review the result.
Write the test task
Start by naming the code and the cases you want covered:
The
InvoiceCalculatorclass has no tests. Write unit tests that cover discounts, tax rounding and invoices with zero items. Use the test setup the project already has.
Add tests for the CSV import in
app/Imports/CustomerImport.php. Cover a valid file, a file with missing columns and a file with duplicate emails.
You don’t need to name your test framework. Vroni reads the project and uses the tools and folder structure already in place. Because Vroni can’t receive API keys, its tests can’t call real outside services, so ask for fakes or mocks wherever the code talks to one.
Create the task in New task.
When the tests find a bug
Testing old code sometimes turns up a bug. Tell Vroni in the task how to handle that. If you only want tests, add a note like: “Don’t change the class. If a test shows a bug, mark that test as skipped and explain the bug in the pull request.” If you want Vroni to fix the bug too, say so.
Cover a bug before you fix it
When you have a bug report, you can ask for a failing test first and the fix second in the same task:
Customers with a 100% discount code get an error at checkout. Write a test that reproduces this and fails, then fix the bug so the test passes. Say in the pull request that the test failed before the fix.
Once you merge the pull request, the test stays in your suite. See Bug fixes for more on this workflow.
One area per task
A prompt like “Raise test coverage” is too broad, and you’d end up paying for Vroni to figure out where to start. Pick one area per task, such as a folder, a module, or a single feature. If your CI tracks coverage, check the numbers there. Vroni’s environment can’t measure PHP coverage, so describe the specific cases you want instead of a target percentage.
Review the tests
Check what the new tests verify. A test that passes without checking anything useful doesn’t help. Read through the test names and a few assertions, and check the pull request description to see which tests Vroni ran. If your CI runs on pull requests, its results will appear there as well. See Pull requests for more on reviewing Vroni’s work.
Last updated November 25, 2026. Something missing or unclear? Write to [email protected].