Write unit tests for this module
Generate thorough unit tests covering the happy path, edge cases, and expected errors. Targets at least 80% coverage with a comment explaining each test's intent.
Preview
Copy prompt
Write a comprehensive unit test suite for the following [Language] function or module: [Paste code]. Use [Testing Framework] and target at least 80% branch coverage. Test the happy path, edge cases (empty input, null values, boundary conditions), and expected error throws. Add a brief comment above each test or group explaining what scenario it validates.
More
Testing
Prompts
