Coding

Write unit tests for a function

Takes a single function plus its test framework (or "unknown" if you're not sure) and writes a practical test suite covering the main happy path, boundary cases, invalid inputs, and expected failure modes. It matches the project's existing test style when one is visible in the pasted context, and states any assumptions it made before showing the actual test code.

Prompt
Write unit tests for this function. Cover the main happy path, boundary cases, invalid inputs, and expected failures. Use the project's existing test style if visible. Explain any assumptions before the test code.

Function:
{{function}}

Test framework:
{{framework}}
Download .md

Variables