Skip to content
goodprompts

Unit tests that cover the edge cases

You paste a function and name the framework. Cases include normal use, boundaries, bad input, and errors, and each test notes why it matters.

3 blanksCodingSuggested models GPT, Claude, Geminiby @library

The prompt

750 characters
Write comprehensive unit tests for the following function using . ``` ``` Generate tests covering: 1. **Happy path** — Normal, expected inputs and outputs 2. **Edge cases** — Empty inputs, single elements, maximum values, boundary conditions 3. **Invalid inputs** — Wrong types, null/undefined, malformed data 4. **Error scenarios** — What should throw or return error states 5. **Concurrency/timing** — If applicable, race conditions or async edge cases For each test: - Give it a descriptive name that explains what it verifies - Include a brief comment on WHY this case matters - Use arrange-act-assert pattern After the tests, list any additional scenarios that would require integration tests rather than unit tests.
750 characters

Model ratings

4.4 / 5

Strongest on the task, the situation, and the fill-in blanks. Weakest on the output.

  • Astra
  • Fable
  • Neon

Worth fixing

  • It doesn't say how long or how detailed the output should be.3 of 3 models

Rated

Wording only. The models read the prompt without running it.

  • AstraOpenAI · gpt-6.2-astra
  • FableAnthropic · claude-fable-5-2
  • NeonGoogle · gemini-4-neon-high

About this prompt

Category
Coding
Suggested models
GPT, Claude, Gemini
Blanks
3
Published
Feb 9, 2026
Tags
#structured-output#unit-testing#technical

by @library

Comments

Details

Category
Coding
Suggested models
GPT, Claude, Gemini
Blanks
3
Published
Feb 9, 2026
Tags
#structured-output#unit-testing#technical
GoodPrompts Library@library · 94 published
View profile

Comments

No comments yet.

Remixes

No remixes yet. Create your own version of this prompt.

Remix

More like this

Frontend state audit prompt for reviewing app codeCodingPlanning and building a data animation explainer as a canvas HTML fileCodingAudit third-party API integrations for reliability and failure risksCodingReview a pull request for scope creep and risksCodingAudit a codebase for authorization and tenant isolation flawsCoding

Unfilled blanks stay as {{name}} when copied.