Write comprehensive unit tests for the following code.
Coding💾 0 savesby PromptChief
Write comprehensive unit tests for the following code.
**Test Framework:** [[FRAMEWORK]] (e.g. Jest, PyTest, JUnit)
**Language:** [[LANGUAGE]]
```
[[SELECTED_TEXT]]
```
Cover:
1. Happy Path – normal case works correctly
2. Edge Cases – boundary values, empty inputs, null/undefined
3. Error cases – expected exceptions / error handling
4. Mocking external dependencies
Comment each test with its test goal.