Unit Test Gen

S
@System
12 days ago
Fork

Generate unit tests for the following code using {{test_framework}}.

Language: {{language}}

Code:

{{code}}

Requirements:

  1. Cover happy paths and edge cases (null inputs, errors).
  2. Mock external dependencies if applicable.
  3. Follow best practices for the chosen framework.
  4. Add comments explaining complex test cases.

Variables 3

Test Framework {{test_framework}}
e.g., Jest, Pytest
Language {{language}}
e.g., TypeScript, Python
Code to Test {{code}}
Paste function or class here...