PhraseryPhrasery homeGet Phrasery
Tests & QA21 categories

Rename these tests so failures explain themselves

When a red CI run tells you `test_handler_2` failed and nothing more.

Longnamingreadabilityreview
Rename the tests below so that the name alone explains a failure.

Rules:
1. Each name should state the condition and the expected behaviour: what is being tested, under what circumstance, and what should happen.
2. Remove "test", "works", "correctly", "should be fine" and the word "and" where it hides two assertions.
3. Match the naming convention already used in the file. Tell me what that convention appears to be.
4. Where a test name cannot be written clearly, the test is probably doing too much. Say which ones, and how to split them.

Output a table: current name, proposed name, and the failure message a developer would see at 2am.

Tests:

Making it yours

  • Paste your own material where the prompt asks for it. Everything above that line is instruction, not content.
  • Delete any rule that does not apply to you. A shorter prompt that fits beats a thorough one that does not.
  • If the answer comes back vague, add a line saying what you do not want. Constraints work better than encouragement.

Reviewing existing tests. Judging naming, mocking, and whether a test asserts behaviour or just the implementation.

Related prompts

Keep this one

Phrasery saves prompts with a right-click and puts them back the same way. Add this to your own library in one click.

Add to your browser โ€” free