Write Missing Tests

Generate a test suite for untested code covering normal paths, edge cases, and error conditions.

Intermediate1 min read

Customize

Fill these in and the prompt below updates as you type. Anything you leave blank stays as a placeholder.

Your prompt

2 placeholders left
I need tests for this existing code:

{{code}}

Generate a test suite using {{test_framework}} that covers:
- Every public function/method
- Normal inputs with expected outputs
- Edge cases (empty inputs, max values, null, special characters)
- Error conditions (what should throw/reject/return errors)
- Integration between functions if applicable

For each test, explain what it's verifying and why that case matters. Organize tests by function with describe/context blocks. Aim for 90%+ code coverage.

Similar prompts

Test-Coverage Review

List the untested edge cases in a diff, then write the tests that would catch them.

Fix a Bug Without Breaking Things

Find every affected code path and the same bug elsewhere before landing the minimal fix.

Function From Requirements

A typed, documented function built to spec — with three unit tests covering the edge and error cases.

Generate Test Fixtures

Happy path, boundary values, and a deliberate failure case — each with a note on what it covers.