Write Jest unit tests for this function/module. Cover normal cases, edge cases, error handling, and mock [dependencies]. Use descriptive test names and arrange-act-assert structure. Code: [paste code]
Results for “unit tests”
All tools
ChatGPT
Claude
Gemini
Midjourney
DALL·E
Stable Diffusion
Flux
Copilot
Runway
Sora
Veo
Kling
Suno
Udio
ElevenLabs
Other
3 prompts
Write a Python class for [purpose, e.g. a shopping cart]. Include type hints, docstrings, validation, a clean public API, and pytest unit tests covering normal use and edge cases.
Coding & Development
Write a Python class with tests
A well-designed Python class with type hints and unit tests.
Act as a senior [language] developer. Write a function that: [describe behaviour] Inputs: [names, types, examples] Output: [type and example] Constraints: [performance, no external libraries, etc.] Include: - Type hints/annotations and a docstring - Input validation and clear error messages - Handling for edge cases (…
Coding & Development
Write a function from a plain-English description
Describe what a function should do and get clean, typed, tested code with edge cases handled.