Add descriptive messages for `assert` statements in tests
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 286
- PR merge metrics
- No merged PRs in 30d
Description
I think, that time passed from discovering, that a test have failed to the time, when we know why it failed should be as small as possible.
To ensure that I'm proposing to fill $message parameter value in each of used assert* statement in tests. This will be especially useful for tests, that contain multiple assert statements, like testAdvancedForm.
Example of bad default error message: "Failed asserting, that false is true".
P.S.
We can look at format of assert messages in Symfony test suite.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate testAdvancedForm and the other tests containing assert* statements, then review how Symfony's test suite formats assertion messages. Add descriptive messages to the assertions so failures identify what was being checked, and verify that all relevant test assertions are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100