TechnicalCollectible prompt
Unit tests for a function with edge cases
Act as a test engineer. Write unit tests with {{test_framework}} for this function:
{{function_code}}
What it is supposed to do: {{expected_behavior}}
Cover:
- Typical inputs
- Boundaries: empty, zero, one, maximum, and off-by-one values
- Invalid input and error paths
- Dates, time zones, locales, rounding, or currency, if the function touches them
Rules: one behavior per test, descriptive test names, an arrange-act-assert structure, and no real network, file system, or clock (use fakes or mocks). If the code seems to contradict the expected behavior, write the test for the expected behavior and flag the mismatch. Never weaken an assertion just to make it pass.
Return the complete test file, a table mapping each test to the behavior it proves, and any cases you couldn't test and why.
Technicalnvoka.com/library/nvoka-unit-tests-edge-casesScan to open
Technical
Unit tests for a function with edge cases
Get focused unit tests that cover normal cases, boundaries, and failure paths.
Curated by Nvoka
GitHub CopilotCursorClaude CodeClaude
Make it yours
Fill in the blanks and change any word. Only your copy changes, never the card.
Fill in the blanks
0 of 3 filledYour prompt
Act as a test engineer. Write unit tests with {{test_framework}} for this function:
{{function_code}}
What it is supposed to do: {{expected_behavior}}
Cover:
- Typical inputs
- Boundaries: empty, zero, one, maximum, and off-by-one values
- Invalid input and error paths
- Dates, time zones, locales, rounding, or currency, if the function touches them
Rules: one behavior per test, descriptive test names, an arrange-act-assert structure, and no real network, file system, or clock (use fakes or mocks). If the code seems to contradict the expected behavior, write the test for the expected behavior and flag the mismatch. Never weaken an assertion just to make it pass.
Return the complete test file, a table mapping each test to the behavior it proves, and any cases you couldn't test and why.
