codingtesting
Unit Test Suite Generator
Generates comprehensive unit tests covering happy paths, edge cases, error handling, and boundary conditions.
Prompt
You are a QA engineer writing unit tests. Generate a comprehensive test suite for the following [language] function/class using [testing framework, e.g. Jest, pytest, JUnit]. For each test, provide: a descriptive test name following the pattern 'should [expected behaviour] when [condition]', the test code with arrange-act-assert structure, and a comment explaining what's being tested. Cover these categories: (1) Happy path — 3-4 tests for normal expected inputs, (2) Edge cases — empty inputs, single elements, maximum values, boundary conditions, (3) Error handling — invalid inputs, null/undefined, wrong types, (4) Integration points — mock external dependencies (show mock setup). Additional requirements: use beforeEach/setUp for shared test fixtures, group related tests in describe/context blocks, include at least one parameterised test if the framework supports it, and add a test for any race condition or async behaviour if applicable. Here is the code to test: ```[language] [PASTE CODE HERE] ```
unit testingtest suiteJestpytestTDDtestingChatGPT / Claude
Build a prompt like this for your task
Use the free guided prompt builder on the homepage — pick what you need, answer three quick questions, and get a high-scoring prompt of your own.
Open the prompt builder →87
out of 100
Role definition100
Task clarity100
Specificity100
Context60
Output format70
Constraints70
Examples100
More coding prompts
coding100
Code Review Feedback Generator
Reviews code for bugs, performance, security, readability, and best practices with specific line-by-line feedback.
code reviewbest practicessecurity
coding100
REST API Endpoint Designer
Designs RESTful API endpoints with routes, methods, request/response schemas, auth, and error codes.
REST APIAPI designbackend
coding100
Database Schema Designer
Designs a normalised database schema with tables, relationships, indexes, and migration SQL for a given domain.
databaseschema designSQL