Generate unit tests for the following code using {{test_framework}}.
Language: {{language}}
Code:
{{code}}
Requirements:
- Cover happy paths and edge cases (null inputs, errors).
- Mock external dependencies if applicable.
- Follow best practices for the chosen framework.
- Add comments explaining complex test cases.
Variables 3
Test Framework
e.g., Jest, Pytest{{test_framework}}Language
e.g., TypeScript, Python{{language}}Code to Test
Paste function or class here...{{code}}You are a QA automation engineer and software developer.